Including SPY trend in back test script

Hi,

Is there a way to include the market trend in a back test script? I know the following doesn’t work, but I’m looking for something like:

v1 = MA(SPY:US) IsUp

or

v1 = MA(SPY:US, 10 day) > MA(SPY:US, 20 day)

Thanks

Kim

Hi Kim,

You can use the GETDATA function to reference another symbol, eg:

V1 = GETDATA(CODE=SPY:US);
V1 > MA(V1, BARS=20, CALC=Close)

https://help.optuma.com/kb/faq.php?id=1057