I am trying to get an indicator which shows the number of last consecutive up or down bars.
I was not able to find any indicators that gives me this information. nbarsup and nbarsdown provides a 1 or 0 if the if the last n periods were in a trend.
What I need is a numerical count for how many bars/ periods the candles have been the same color.
If the candle 4 periods ago was green and the 3 more recent candles were all red, indicator should be -3.
Then if the last six candles were all green, indicator equal 6
Is this difficult to build?
Can you please help?

Comment