- Topics: 5
- Replies: 293
- Posts: 298
Because the Show Bar had been applied directly to the RIC tool, you did not need to set the RIC details in the script. The show bar was referencing that as the main data source already, so the script Darren gave you worked for that scenario.
Moving from a Show Bar applied to the RIC directly, to the Back Tester, the RIC needs to be setup in the script as the code being back tested is now the main data source.
For the Back Tester, your original script (with the duplicate z1 line removed) should produce the result you’re looking for:
// calculate the 200 ema of the ric of security to spx
r1 = RIC(DATESEL=Year To Date, ZEROBASED=True, INDEX=SPX:WI);
m1 = MA(r1,BARS=200, STYLE=Exponential, CALC=Close);
r1 CrossesAbove m1