MTF Indicator generating error message
Forums › ProRealTime English forum › ProBuilder support › MTF Indicator generating error message
- This topic has 4 replies, 2 voices, and was last updated 3 years ago by Nicolas.
Tagged: ElderrayBearPower, ElderrayBullPower
-
-
02/19/2021 at 3:26 PM #162004
Hello,
I’m running PRT v11 (demo account) and trying to code the follwing indicator with TF M2 and TF M5, but I keep getting an error message. Can you please help?
Thanks
Error Multiframe Indicator1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465DEFPARAM CALCULATEONLASTBARS=2000TIMEFRAME(5 minutes, UPDATEONCLOSE)Price1=(open+high+low+2*close)/5Period1 = 8//21nbChandelier1= 1BullBearThreshold1=1// Moving Averages SlopeMM1 = VolumeAdjustedAverage[Period1](Price1)Slope1 = (MM1-MM1[nbchandelier1])/nbchandelier1EMASlope1=ExponentialAverage[Period1](Slope1)ca1m2= ((slope1>EMASlope1 and slope1>slope1[1]) or (slope1>slope1[1] and slope1[1]>slope1[2]))cv1m2= ((slope1<EMASlope1 and slope1<slope1[1]) or (slope1<slope1[1] and slope1[1]<slope1[2]))// Elder RayTIMEFRAME(2 minutes, UPDATEONCLOSE)BullPower1 = ElderrayBullPower[13](close)BearPower1 = ElderrayBearPower[13](close)ADJASUROPPO1 = (BullPower1-BullPower1[nbchandelier1]) / nbChandelier1ANGLE1 = (ATAN(ADJASUROPPO1))ADJASUROPPO2 = ((BearPower1-BearPower1[nbchandelier1]) / nbChandelier1)ANGLE2 = (ATAN(ADJASUROPPO2))TrendUp1=0TrendDown1=0if angle1>45 and angle2>45 thenTrendUp1=1elsif angle1<-45 and angle2<-45 thenTrendDown1=-1endif/////////////////////////////////////////////////////////////Bullm2=0Bearm2=0Bullm2= ca1m2Bearm2= -cv1m2if (bullm2+bearm2)>=BullBearThreshold1 and trendup1 thenr=0g=102b=0DRAWARROWUP(barindex, -5) coloured(0,102,0)elsif (bullm2+bearm2)>0 thenr=0g=255b=0endifif (bullm2+bearm2)<=-BullBearThreshold1 and trenddown1 thenr=204g=0b=0DRAWARROWDOWN(barindex, 5) coloured(204,0,0)elsif (bullm2+bearm2)<0 thenr=255g=51b=51endif//////////////////////////////////return 6, -6, (Bullm2+Bearm2) coloured(r, g, b) as "Bull M2M5", 0 as "Base"02/19/2021 at 3:38 PM #16201302/19/2021 at 4:16 PM #162016The problem seems to be located with lines 20 and 21 (definition of Elderraybullpower and Elderraybearpower), if you change them with:
12BullPower1 = average[13]//ElderrayBullPower[13](close)BearPower1 = average[13]//ElderrayBearPower[13](close)the error message disappear.
Please send a report to PRT within the help tool in the platform, i’ll do the same.
A workaround would be to recode these 2 indicators, so we get rid of the instructions, will try to find their codes.
1 user thanked author for this post.
02/19/2021 at 6:08 PM #162031Thank you Nicolas, like usual, quick and efficient! Much appreciated.
I replaced Elder Ray with:
Elder Ray12345ema13=ExponentialAverage[13](Price1)HH=highLL=LowBullPower1=HH-ema13BearPower1=LL-ema13it works, but doesn’t want to draw the arrow 🙂
03/01/2021 at 12:46 PM #162852 -
AuthorPosts
Find exclusive trading pro-tools on