I'm looking for an indicator that shows me the number of bars up / down up to the current moment from a variable timespan.
So if up to today we have 4 consecutive updays, i want the indicator to show the number 4. If we have 4 up days, followed by one down day i want the indicator to show -1. If we have 5 up days, followed by 3 downdays, followed by 1 up day, i want the indicator to show 1.
So basically when an up day is followed by a down day, the indicator is reset and the most recent direction prevails.
I've tried building it with NBarsUp / NBarsDown but so far unsuccesfull.
Maybe somebody can help me out.
Thanks
Comment