Indicator does not calculate below 1 hour timeframe
Forums › ProRealTime English forum › ProBuilder support › Indicator does not calculate below 1 hour timeframe
- This topic has 4 replies, 1 voice, and was last updated 2 years ago by pp_playaflamenca.
-
-
08/09/2019 at 3:52 PM #104482
You can see in the screenshots. On the hourly or above, my daily ADR projection works.
but when I move to the 30 minutes chart, it says the ADR is zero.
Anyone know why?
ADR projections123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104//Grantx ADRdefparam drawonlastbaronly=true//--- settingsADRperiod = 30//--- end of settingsDayRngeSum = 0FOR a = 0 to ADRperiod DODayRngeSum = DayRngeSum + (DHigh(a) - DLow(a))NEXTadr = DayRngeSum / ADRperiod//vertical offset to draw text correctly over horizontal linesif(ticksize=1) THEN //Dow//Voffset = 15*ticksizeVoffset2 = 100*ticksizemultiplier = 1TodayRange = dhigh(0)- dlow(0)TodayRangePoints = TodayRangeMidRange = dhigh(0) - ((dhigh(0)- dlow(0)) / 2)adr = Round(adr * multiplier)ELSIF(ticksize=0.0001) THEN //Euro//Voffset = 3*ticksizeVoffset2 = 10*ticksizemultiplier = 10000TodayRange = (dhigh(0)- dlow(0))*multiplierTodayRangePoints = TodayRange/4MidRange = dhigh(0) - ((dhigh(0)- dlow(0)) / 2)adr = Round(adr * multiplier)ELSIF(ticksize=0.1) THEN //Gold//Voffset = 1*ticksizeVoffset2 = 25*ticksizemultiplier = 10TodayRange = (dhigh(0)- dlow(0))*multiplierTodayRangePoints = TodayRange/10MidRange = dhigh(0) - ((dhigh(0)- dlow(0)) / 2)adr = Round(adr * multiplier)ELSIF(ticksize=0.25) THEN //S&P500//Voffset = 4*ticksizeVoffset2 = 20*ticksizemultiplier = 4TodayRange = (dhigh(0)- dlow(0))*multiplier //Because ticksize is 0.25TodayRangePoints = TodayRange/4MidRange = dhigh(0) - ((dhigh(0)- dlow(0)) / 2)adr = Round(adr * multiplier)ELSE//Voffset = 3*ticksize//Voffset2 = 5*ticksizeENDIF//Have to multiply ticksize by the ADR because ADR could be 42 which pushes the indicator off eh chartts = ticksize * adr//tsize = ticksize//DayConstant = dayHIDaily1 = dhigh(0)LOWDaily1 = dlow(0)HIGHDailyProjection = LOWDaily1 + tsLOWDailyProjection = HIDaily1 - ts//bar0 = Range * multiplier//bar1 = Range[1] * multiplier//bar2 = Range[2] * multiplier//bar3 = Range[3] * multiplier//bar4 = Range[4] * multiplier//Show us where the start of ADR calculation is//This wont work because when you change timeframe//DRAWARROWDOWN(barindex[60],high[60] +Voffset2)coloured(0,102,204)//DRAWARROWUP(barindex[60],low[60]-Voffset2)coloured(0,102,204)DRAWSEGMENT(barindex[4], HIDaily1, barindex, HIDaily1) coloured(255,10,10)DRAWSEGMENT(barindex[4], LOWDaily1, barindex, LOWDaily1) coloured(255,10,10)DRAWSEGMENT(barindex[4], HIGHDailyProjection, barindex, HIGHDailyProjection) coloured(0,128,255)DRAWSEGMENT(barindex[4], LOWDailyProjection, barindex, LOWDailyProjection) coloured(0,128,255)//DRAWHLINE(HIGHDailyProjection)coloured(255,128,10)//DRAWHLINE(LOWDailyProjection)coloured(255,128,10)//center=barindex+10drawtext(" High: #HIDaily1#",barindex,dhigh(0),Dialog,Standard,10) coloured(204,0,0)drawtext(" Low: #LOWDaily1#",barindex,dlow(0),Dialog,Standard,10) coloured(204,0,0)drawtext(" HDP",barindex,HIGHDailyProjection+Voffset2,Dialog,Standard,10) coloured(0,0,255)drawtext(" LDP",barindex,LOWDailyProjection-Voffset2,Dialog,Standard,10) coloured(0,0,255)drawtext(" Todays Range Ticks=#TodayRange#",barindex,MidRange,Dialog,Standard,10) coloured(0,0,255)drawtext(" Todays Range Points=#TodayRangePoints#",barindex,MidRange-Voffset2,Dialog,Standard,10) coloured(0,0,255)drawtext(" ADR(#ADRperiod#)=#adr#",barindex,MidRange-(Voffset2*2),Dialog,Standard,10) coloured(0,0,255)//drawtext(" Bar (0) Range=#bar0#",barindex,MidRange-(Voffset2*2),Dialog,Standard,10) coloured(0,0,255)//drawtext(" Bar (1) Range= #bar1#",barindex,MidRange-(Voffset2*3),Dialog,Standard,10) coloured(0,0,255)//drawtext(" Bar (2) Range= #bar2#",barindex,MidRange-(Voffset2*4),Dialog,Standard,10) coloured(0,0,255)//drawtext(" Bar (3) Range= #bar3#",barindex,MidRange-(Voffset2*5),Dialog,Standard,10) coloured(0,0,255)//drawtext(" Bar (4) Range= #bar4#",barindex,MidRange-(Voffset2*6),Dialog,Standard,10) coloured(0,0,255)//drawtext(" ADR*ticksize=#ts#",barindex,LOWDailyProjection-Voffset4,Dialog,Standard,10) coloured(0,0,255)//drawtext(" HighProjectionPrice=#HIGHDailyProjection#",barindex,LOWDailyProjection-Voffset5,Dialog,Standard,10) coloured(0,0,255)//drawtext(" LowProjectionPrice=#LOWDailyProjection#",barindex,LOWDailyProjection-Voffset6,Dialog,Standard,10) coloured(0,0,255)//drawtext(" Day Constant=#DayConstant#",barindex,LOWDailyProjection-Voffset7,Dialog,Standard,10) coloured(0,0,255)RETURN08/09/2019 at 4:23 PM #104486I suggest that you convert it into a strategy, then run it to GRAPH all variables involved in the wrong calculation.
To make a strategy out of it simply comment out line 3 and all graphic instructions, then add at the end:
12345buy at -close limitgraph ....graph ....graph ....graph ....replacing dots with your variables. On a demo account you can GRAPH an unlimited number of variables, while on real account there’s a limit of 5 variables, as of v10.3.
1 user thanked author for this post.
08/09/2019 at 6:30 PM #10449408/09/2019 at 6:49 PM #104497ProBuilder does not support Multiple Time Frames, so the workaround is to convert an indicator into a strategy and use GRAPHONPRICE instead of RETURN to plot data on the price chart, but you won’t be able to use graphic instructions and you will have to keep the strategy running.
1 user thanked author for this post.
01/03/2022 at 12:56 AM #184373On other hand, we must be asured we have enough units of candles, in order the calculations to be done. For exemple ADR(20) for 20 days average, means 20x48x30 = 16800 minimum minute candle units. May be if you have not downloaded units candle history enough, the result of calculus would be 0 in some cases.
-
AuthorPosts
Find exclusive trading pro-tools on