Hi, you can use static series for the equity curve and shift them by script when the system is in the market and otherwise not. For a static series use a negative length like this

vars EquityCurve = series(EquityLong+EquityShort,-LookBack);

and for shifting when in the market

if(NumOpenLong+NumOpenShort > 0) shift(EquityCurve,EquityLong+EquityShort,LookBack);

Hope this helps!