Momentum Calculation Question

Gents,

I am attempting to create a Momentum Factor that measures the percentage of the time a security has been above it’s 200 day Moving Average over the previous year. Currently, I am using the following equation to do this

LoopAvg(“Close(CTR)>=EMA(200,CTR)”,100,0)

This calculation works, but the LoopAvg function is limited to a maximum of 100 iterations so I am unable to perform the calculation for a full year.

Does anyone have any suggestions for another way to calculate this that will allow for a year of history? Are there any predefined variables in Portfolio123 that will give me this number?

Thanks,

Daniel

Maybe use offsets to calculate four 60-bar periods and just add them together?

brilliant, thank you sir