We recommend running backtests on order book or tick data for maximum realism and accuracy.
Running backtests on bar data by pre-processing bars into ticks has been possible, however occasionally produces some surprising results. To help offset this until a full refactoring pass of the OrderBook and SimulatedExchange matching engine is carried out, two options have been added.
fill_limit_at_price.
fill_stop_at_price.
These boolean flags are available when adding a venue to a BacktestEngine. They result in orders being filled at their original price (preventing/overriding any slippage for STOP_MARKET orders, or executions away from the orders price for LIMIT orders).
We recommend running backtests on order book or tick data for maximum realism and accuracy.
Running backtests on bar data by pre-processing bars into ticks has been possible, however occasionally produces some surprising results. To help offset this until a full refactoring pass of the
OrderBook
andSimulatedExchange
matching engine is carried out, two options have been added.fill_limit_at_price
.fill_stop_at_price
.These boolean flags are available when adding a venue to a
BacktestEngine
. They result in orders being filled at their original price (preventing/overriding any slippage forSTOP_MARKET
orders, or executions away from the orders price forLIMIT
orders).