I understand: 

  1. When an algorithm uses daily resolution, the data becomes available at 16:00 (close)
  2. When a market order is placed after hours, LEAN converts it to a Market On Open order

 

This makes sense. But I struggle to reconcile this for live trading vs. backtest. In backtesting, are the fills recorded same day at 16:00, or following morning at 09:31? 

‘Orders’ tab of my backtests appear to show 16:00 (which would use closing prices), but then if I deploy to live trading and the trades are now made following morning at 09:31 from resulting MOO order, this would create a HUGE discrepancy for live trading that isn't modelled in backtesting if the trades are now taken the morning after when the signal is generated…

Key data used in my algorithm is only available in daily resolution (VIX, VIX3M, VIX6M etc) which means I cannot select a denser resolution and consolidate, so if this is the case, I am lost as to how I can ensure orders fill same day. 

Desired outcome is having orders filled at market close, same moment OnData() fires, using all daily resolution.

Any help is appreciated :)

Author

Eli Laycock

2 days ago