AddColumn(LastValue(BarsSince(C < MA(Close,100))),"b");
I can get no of days when Close larger than MA100, but anyone can tell the the reason why the formula is <(less than) , not the sign > (larger than).
LastValue(BarsSince(C < MA(Close,100)
AddColumn(LastValue(BarsSince(C < MA(Close,100))),"b");
I can get no of days when Close larger than MA100, but anyone can tell the the reason why the formula is <(less than) , not the sign > (larger than).
LastValue(BarsSince(C < MA(Close,100)
You are counting bars SINCE it was below – that’s what the “<” does – that way you begin counting numBarsAbove.