Simulated Strategy Hedge

Hi all, I'm trying to simulate a stock strategy that would swtich to cash (1Y Treasuries to be precise) once the benchmark falls below its 200d EMA. I'm struggling to understand how to set this up in the Entrey and Exit rules of the 'Hedge' section of simulated strategies.
Thanks a lot for your help.

The rules would be:
Entry rule: Close(0,#Bench) < EMA(200,0,#Bench)
Exit rule is: Close(0,#Bench) > EMA(200,0,#Bench)

If you wanted to use something other than the benchmark, then user GetSeries like this:
Close(0,GetSeries("SPY")) < EMA(200,0,GetSeries("SPY"))
Close(0,GetSeries("SPY")) > EMA(200,0,GetSeries("SPY"))

1 Like