Rolling date boolean question

Hi Darren, just a quick one question.

For example: MA(BARS=200, CALC=Close) IsUp - shows current bar true or false


v1 = MA(BARS=200, CALC=Close) IsUp

v1[5] - shows if it was true or false 5 days ago… but I am looking for a running total of the past 5 days? if it is true or false. I looked at “range()” but I couldn’t figure out how to keep it rolling the dates.

I looked over this forum but haven’t found a code… is there a code to perform this action? look forward to your reply

Grant

Hey Grant,

Try the BarsTrue function: https://help.optuma.com/kb/faq.php?id=1118

V1 = MA(BARS=200, CALC=Close) IsUp;
BARSTRUE(V1, LOOKBACK=5)

This will give a total over the last 5 rolling days on a daily chart Show View or watchlist:

Capture