Automatic Daily Pivot Caculator
Forums › ProRealTime English forum › ProBuilder support › Automatic Daily Pivot Caculator
- This topic has 8 replies, 2 voices, and was last updated 6 years ago by saif.
-
-
01/22/2018 at 5:27 AM #6011801/22/2018 at 10:01 AM #6013401/22/2018 at 11:00 AM #6014101/22/2018 at 11:04 AM #6014201/22/2018 at 12:23 PM #60154
I modified the indicator, it should looks how you want now ..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475defparam drawonlastbaronly = trueMP = UNDEFINEDCBOL = UNDEFINEDCBOS = UNDEFINED//CSHT = UNDEFINED//CLNG = UNDEFINEDMR3 = UNDEFINEDMR2 = UNDEFINEDMR1 = UNDEFINEDMS1 = UNDEFINEDMS2 = UNDEFINEDMS3 = UNDEFINEDMMLO = UNDEFINEDMMHI = UNDEFINEDMGAP = UNDEFINEDMPDH = UNDEFINEDMPDL = UNDEFINEDSHOW = (TodayOnly and DATE[0] > Yesterday)IF SHOW or NOT TodayOnly THENMP = ( (MClose + MHi + MLo ) / 3)CBOL = MClose + ( ( (MHi - MLo) * 1.1) / 2)CBOS = MClose - ( ( (MHi - MLo ) * 1.1) / 2)MR3 = MHi + ( 2 * (MP - MLo) )MR2 = MP + (MHi - MLo)MR1 = (2 * MP) - MLoMS1 = (2 * MP) - MHiMS2 = MP - (MHi - MLo)MS3 = MLo - ( 2 * (MHi - MP) )MMLO = MLOMMHI = MHIMPDH = PDHMPDL = PDLMGAP = MCLOSE//vertical offsetto draw text correctly over horizontal linesVoffset = 1*pipsize//draw pivot points textDRAWTEXT(" Daily Pivot",barindex-2,MP+Voffset,SansSerif,Bold,10)DRAWTEXT(" CBOL",barindex-2,CBOL+Voffset,SansSerif,Bold,10)DRAWTEXT(" CBOS",barindex-2,CBOS+Voffset,SansSerif,Bold,10)DRAWTEXT(" DR3",barindex-2,MR3+Voffset,SansSerif,Bold,10)DRAWTEXT(" DR2",barindex-2,MR2+Voffset,SansSerif,Bold,10)DRAWTEXT(" DR1",barindex-2,MR1+Voffset,SansSerif,Bold,10)DRAWTEXT(" DS1",barindex-2,MS1+Voffset,SansSerif,Bold,10)DRAWTEXT(" DS2",barindex-2,MS2+Voffset,SansSerif,Bold,10)DRAWTEXT(" DS3",barindex-2,MS3+Voffset,SansSerif,Bold,10)DRAWTEXT(" Daily High",barindex-2,MMHI+Voffset,SansSerif,Bold,10)DRAWTEXT(" Daily Low",barindex-2,MMLO+Voffset,SansSerif,Bold,10)DRAWTEXT(" Close",barindex-2,MGAP+Voffset,SansSerif,Bold,10)DRAWTEXT(" 2DHigh",barindex-2,MPDH+Voffset,SansSerif,Bold,10)DRAWTEXT(" 2DLow",barindex-2,MPDL+Voffset,SansSerif,Bold,10)DRAWHLINE(MP)COLOURED(95,95,100)DRAWHLINE(CBOL)DRAWHLINE(cbos)drawhline(mr3)COLOURED (235,5,30)drawhline(mr2)COLOURED (235,5,30)drawhline(mr1)COLOURED (235,5,30)drawhline(ms3)COLOURED(30,235,5)drawhline(ms2)COLOURED(30,235,5)drawhline(ms1)COLOURED(30,235,5)drawhline(mmhi)COLOURED(45,75,240)drawhline(mmlo)COLOURED(45,75,240)drawhline(mpdh)COLOURED(45,75,240)drawhline(mpdl)COLOURED(45,75,240)ENDIFRETURN// MP COLOURED(95,95,100) as "Pivot", CBOL as "CBOL", CLNG COLOURED(30,235,5) as "CLNG", CSHT COLOURED(30,235,5) as "CSHT", CBOS as "CBOS", MR3 COLOURED (235,5,30) as "R3", MR2 COLOURED (235,5,30) as "R2", MR1 COLOURED (235,5,30) as "R1", MS1 COLOURED(30,235,5) as "S1", MS2 COLOURED(30,235,5) as "S2", MS3 COLOURED(30,235,5) as "S3", MGAP COLOURED(235,5,30) as "Close", MMHi COLOURED(45,75,240) as "Hi", MMLo COLOURED(45,75,240) as "Lo", MPDH COLOURED(45,75,240) as "PDH", MPDL COLOURED(45,75,240) as "PDL"// To set your own colours REM out above line and undo line belowREM RETURN MP as "Pivot", CBOL as "CBOL", CLNG as "CLNG", CSHT as "CSHT", CBOS as "CBOS", MR3 as "R3", MR2 as "R2", MR1 as "R1", MS1 as "S1", MS2 as "S2", MS3 as "S3", MGAP as "Gap", MMHi as "Hi", MMLo as "Lo", MPDH as "PDH", MPDL as "PDL"I noticed that you update manually the variables to make the calculation the pivot points, it could be made automatically, could you tell me what are these manual values?
1 user thanked author for this post.
01/22/2018 at 1:39 PM #60165Thank you very much Nicolas. I used horizontal lines to enter the daily levels manually but I can now use this indicator to automatically populate the levels using EOD data.
I modified using your inputs but still having the Texts( Labels) in the middle and not on the right, just before Y Axis. Is there also a way to display the value of each line as well.
Please look in to this when time permits.
I can’t thank you enough for helping me.
Cheers mate.
01/22/2018 at 5:55 PM #60200The only possibility to get the title on the right of the chart is by adding blank space before them, just like I did in the code I posted previously. But since the X axis is based on bars (time), and not pixels, the text could be far or near the candlesticks, depending on the timeframe or the zoom in/out you made.
It’s possible to add values on each of the line, just add the variable name between 2 #, like in my example below:
1DRAWTEXT(" 2DLow - #MPDL#",barindex-2,MPDL+Voffset,SansSerif,Bold,10)1 user thanked author for this post.
01/23/2018 at 1:35 PM #6032101/29/2018 at 6:39 AM #60793 -
AuthorPosts
Find exclusive trading pro-tools on