Thanks a lot for your inputs.

I'd love to user higher resolution than daily bars, however using daily bars is a pretty good idea and at least for daily bars I have been able to replicate it in Zorro.

TradeStation usually displays bars in the user's local time or exchange time, so I first had to convert the closing time to 0:00 UTC. After that I converted the TS csv file to t6. Using Weekend = 0 and leaving leaving BarOffset and BarZone at its default did the trick for mimicking TS's bars.


I haven't realised that Fill can be changed several times within the script. This worked!

For now I left Slippage and commission at 0. I tested a simple mean reverting SPY strategy from 2010 till today with more than 200 trades.

Surprisingly TS and Zorro's trade results matched on the cent!

I tested several combinations such as entering at this close and exiting at the next bar's open, etc. and all of them matched.


TradeStation's buy() this bar at close is identical to Fill = 0 (or 1); enterLong();

TradeStation's sell() next bar at open is identical to Fill = 3; exitLong();



Regarding TimeFrame, I experimented quite a lot but still haven't been able to get it working. Basically it's always the same issue in that the current open is equal to the previous close even when there is a gap in-between.

Would you suggest using two different frames, one for the open and one for the close?