Rob hoffman method indicator
Forums › ProRealTime English forum › ProBuilder support › Rob hoffman method indicator
- This topic has 3 replies, 2 voices, and was last updated 10 months ago by pror.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
01/12/2024 at 1:22 PM #226276
Hi i wanna use and test some things with the rob hoffman method, but i get an error and dont know exactly the right code.
I want a arrow being plotted when the signal comes. but there i get an error at these lines
if bulltrend
drawcandle(open, high, low, close, color.green)
else
if beartrend
drawcandle(open, high, low, close, color.red)123456789101112131415161718192021222324252627282930313233343536373839// Define inputsc = 2.8 // factor used to calibrate the shape of the hammer candle used as a signalgradient = 1 // slope of moving averages// Calculate moving averagesaverage1 = average[5](close)average2 = average[20](close)average3 = average[50](close)average4 = average[100](close)// Define trend conditionsbulltrend1 = average1 - average1[2] > gradient and average1 < closebulltrend2 = average1 - average2[2] > gradient and average2 < closebulltrend3 = average3 - average3[2] > gradient and average3 < closebulltrend4 = average4 - average4[2] > gradient and average4 < closebulltrend = bulltrend1 and bulltrend2 and bulltrend3 and bulltrend4beartrend1 = average1 - average1[2] < -gradient and close < average1beartrend2 = average1 - average2[2] < -gradient and close < average2beartrend3 = average3 - average3[2] < -gradient and close < average3beartrend4 = average4 - average4[2] < -gradient and close < average4beartrend = beartrend1 and beartrend2 and beartrend3 and beartrend4// Plot candles based on trendif bulltrenddrawcandle(open, high, low, close, color.green)elseif beartrenddrawcandle(open, high, low, close, color.red)// Plot hammer candleshammerup = abs(open - close) < (high - low) / 2 and close > high - (high - low) / c and open > high - (high - low) / chammerdown = abs(open - close) < (high - low) / 2 and close < low + (high - low) / c and open < low + (high - low) / cplotshape(series=hammerup, title="Hammer Up", color=color.green, style=shape.triangleup, location=location.belowbar)plotshape(series=hammerdown, title="Hammer Down", color=color.red, style=shape.triangledown, location=location.abovebar)01/12/2024 at 1:58 PM #22628001/12/2024 at 2:03 PM #22628112345678910111213141516171819202122232425262728293031323334353637// Define inputsc = 2.8 // factor used to calibrate the shape of the hammer candle used as a signalgradient = 1 // slope of moving averages// Calculate moving averagesaverage1 = average[5](close)average2 = average[20](close)average3 = average[50](close)average4 = average[100](close)// Define trend conditionsbulltrend1 = average1 - average1[2] > gradient and average1 < closebulltrend2 = average1 - average2[2] > gradient and average2 < closebulltrend3 = average3 - average3[2] > gradient and average3 < closebulltrend4 = average4 - average4[2] > gradient and average4 < closebulltrend = bulltrend1 and bulltrend2 and bulltrend3 and bulltrend4beartrend1 = average1 - average1[2] < -gradient and close < average1beartrend2 = average1 - average2[2] < -gradient and close < average2beartrend3 = average3 - average3[2] < -gradient and close < average3beartrend4 = average4 - average4[2] < -gradient and close < average4beartrend = beartrend1 and beartrend2 and beartrend3 and beartrend4// Plot candles based on trendif bulltrend thendrawcandle(open, high, low, close)COLOURED("green")elsif beartrend thendrawcandle(open, high, low, close)COLOURED("red")ENDIF// Plot hammer candleshammerup = abs(open - close) < (high - low) / 2 and close > high - (high - low) / c and open > high - (high - low) / chammerdown = abs(open - close) < (high - low) / 2 and close < low + (high - low) / c and open < low + (high - low) / creturn//plotshape(series=hammerup, title="Hammer Up", color=color.green, style=shape.triangleup, location=location.belowbar)//plotshape(series=hammerdown, title="Hammer Down", color=color.red, style=shape.triangledown, location=location.abovebar)01/12/2024 at 2:15 PM #226282hi,I hope this will help you1234567891011121314151617181920212223242526272829303132333435363738394041424344// Define inputs//c = 2.8 // factor used to calibrate the shape of the hammer candle used as a signal//gradient = 1 // slope of moving averages// Calculate moving averagesaverage1 = average[5](close)average2 = average[20](close)average3 = average[50](close)average4 = average[100](close)// Define trend conditionsbulltrend1 = average1 - average1[2] > gradient and average1 < closebulltrend2 = average1 - average2[2] > gradient and average2 < closebulltrend3 = average3 - average3[2] > gradient and average3 < closebulltrend4 = average4 - average4[2] > gradient and average4 < closebulltrend = bulltrend1 and bulltrend2 and bulltrend3 and bulltrend4beartrend1 = average1 - average1[2] < -gradient and close < average1beartrend2 = average1 - average2[2] < -gradient and close < average2beartrend3 = average3 - average3[2] < -gradient and close < average3beartrend4 = average4 - average4[2] < -gradient and close < average4beartrend = beartrend1 and beartrend2 and beartrend3 and beartrend4// Plot candles based on trendif bulltrend thendrawcandle(open, high, low, close)COLOURED("green")elsif beartrend thendrawcandle(open, high, low, close)COLOURED("red")ENDIF// Plot hammer candleshammerup = abs(open - close) < (high - low) / 2 and close > high - (high - low) / c and open > high - (high - low) / chammerdown = abs(open - close) < (high - low) / 2 and close < low + (high - low) / c and open < low + (high - low) / cif hammerup thenDRAWARROWUP(barindex, low)endifif hammerdown thenDRAWARROWdown(barindex, high)endifreturn//plotshape(series=hammerup, title="Hammer Up", color=color.green, style=shape.triangleup, location=location.belowbar)//plotshape(series=hammerdown, title="Hammer Down", color=color.red, style=shape.triangledown, location=location.abovebar) -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: