View Full Version : Default Fill Algorithm used when in replay ...
01-25-2008, 03:45 PM
I reviewed the code for the default fill type and it seems to fill limit orders when the symbol traded through the limit price, not to the limit price.
With this context, here is my question:
When a strategy is being run in Replay mode using the default fill option, it seems to sometimes fill when prices trade through the limit order and sometimes when prices trade at the limit order...
I am trying to understand how the default fill algorithm is applied to Bid/Ask when in replay mode. When I looked at it, it did not seem to reference Bid price / volume or Ask Price / volume ... Am I right in this impression or are there 2 fill types -one for replay and one for backtest (And I was only looking at the backtest fill type code)?
Thanks for your help,
01-26-2008, 09:05 AM
When a strategy runs in real-time, the fill algorithm used is our simulation engine --> Not the same as on historical bars.
01-26-2008, 01:25 PM
Thanks. Just for my clarity then ...
1) When a strategy runs on backtest or optimization in the strategy analyzer, the code contained in either the default fill type or the liberal fill type drives the fill behavior of the test / optimization.
2) When a strategy runs live in the simulation account the fill algorithm used is the NinjaTrader simulation engine. Am I right in assuming that the algorithm used in this engine triggers fills from the Bid / Ask price and volume rather than the traded prices? Does it also consider the length of time an order has "been in the que"? (I assume it also considers the exchange data delay settings in the Simulator options tab.)
3) When the simulator engine fill algorithms are running with live data in the simulation account the Liberal vs. Default Historical option in Historical Fill processing (When the strategy is being set up) has no effect on the behavior of the simulation fill algorithms. Is this the case?
4) When a Strategy is run in REPLAY, am I also right in assuming that it is the simulator algorithm that drives the fills and the Historical Fills Processing option of Liberal vs. Default has no effect on the fills when running in replay?
Thanks in advance for helping me increase my clarity in interpreting test results.
01-26-2008, 01:36 PM
One more thing to increase my understanding ...
When running in Live simulation account or in replay, The "Enforce Immediate Fills" option in the simulator tab of options changes the Fill algorithm used in the simulator so that fills are not based on Bid / Ask and they simply occur if the price of a limit order is touched by the price action of the instrument. Is this the case?
If so, the most realistic way to get an understanding of the performance of a strategy is by running in live / replay with the Enforce Immediate Fills option unchecked.
Do I have this all straight in my head?
01-26-2008, 03:16 PM
2) Unfortunately we can no disclose the fill logic of the realtime/replay simulator since this is one of our competitive advantages
"enforce partial fills" has no effect on backtesting