I am looking to calculate the average percentage gain of up days over the past 200 trading days using the following script:
UpClose = CLOSE() IsUp;
UpGain = If( UpClose, ROC(), 0 );
AvgGain = MA(UpGain, BARS=200);
If I use ROC(1) in my calculation I receive negative values, which does not make sense to me.
If I use CHANGE(1), I get results that appear to make more sense (all positive values), but now questioning my methodology.
Can you please advise what I am missing?
Thank you,
Eric