What does this line say?

Hi, I think this line says the close must be above the 200 day MAV of close in the past 100 days....do you agree? Or have I got it wrong?
Thanks in advance.

c > Ref(MA(c,200), -1 * 100)

Close is above the value of 200-bar moving average 100 bars before the current bar. So not just any bar in the past but exactly the value of the MA 200 as it was 100 bars before current bar.

CHeers Ziza...appreciated.

Okay, I give up...can anyone help me with code to say "the close must be above the 200 day MAV of close for x days" please?
Thanks in advance...I've also tried the below...but it does not provide the right outcome.


E.g. to check for Close being consecutively above MA for x days you may use Sum() function to sum up Close > MA occurrences. In order to make result returning true or false you would need to add to it an equality check (via == operator) against some x_days threshold value.


x_days = 10;
cond = C > MA(C,200);
// Close above MA consecutively for x days being TRUE?
is_above_ma_since = Sum(cond, x_days) == x_days;

Buy = is_above_ma_since;