I want to integrate a “ROC-Index” in my screeners to sort the results.
Acc. to the IBD strength rate this shall be to ROC of the last 4 quarters, current quarter double weighed:
ROCQ1 = (close[1] / close[1st day of current quarter] – 1) * 100 * 2
ROCQ2 = (close[last day of previous quarter] / close[1st day of previous quarter] – 1) * 100 * 1
etc. ROCQ3 and ROCQ4
I don’t want to have rolling 3-months-periods but fixed quarters (Jan – Mar / Apr – Jun / Jul – Sep / Oct – Dec).
Anybody here who could help me how to program this part of a screener?