How to access last bar/time-period?

I need to know how can the last bar be accessed in tradeScrip. For example if I want Simple Moving Average of (High+Low)/2 for 5 period of the current bar and same for the previous bar:

SET CURR = SMA((HIGH+LOW)/2, 5)

What should be for the previous bar:
SET PREV = SMA((HIGH+LOW)/2, 5, +1 ???)

Thanks !

for Previous bar you have to use REF(condition,1)  

example

REF(SMA(CLOSE,1),1)

Thanks, will try this tmrw… :slight_smile: