A request that was addressed to ProRealTime:
I want a method to get the “PREVIOUS HIGH, PREVIOUS LOW & PREVIOUS CLOSE” of previous year.
Suggestion for an anwser:
You must select the data from the beginning of last year
once currenthigh=high
once currentlow=low
once previousclose=undefined
once previoushigh=undefined
once previouslow=undefined
if openyear <> openyear[1] then
previousclose=close[1]
previoushigh=currenthigh
previouslow=currentlow
currenthigh=high
currentlow=low
else
currenthigh=max(high,currenthigh)
currentlow=min(low,currentlow)
endif
return previoushigh as "previous year high",previouslow as "previous year low",previousclose as "previous year close"