-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enhance backtest execution model with state-aware fills #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report. The current execution simulation for backtesting is stateless - only considering the book at each time point based on historical data, and does not change the book state based on user orders, or persist any memory of previous fills. The core fill simulation function is here (and so the system is operating to spec). This is also described here in the backtesting docs, and mentioned on the ROADMAP - additional enhancements, so improving this would have a higher priority than many other categories of feature requests (when bandwidth can be allocated). It's also worth considering that running backtests based on trades with no further pre-processing will be unrealistic, because there would most likely be more size available at the top of the book than the size of an individual trade. |
Hi @cjdsellers. I must have missed that. Thank you for the advise. I want to use trade ticks + (possibly L2/L3 quote ticks, when slow backtest doesn't matter), or trade based bars (when performance for ML is needed) as on non-liquid pairs I want to act mainly as maker and top of the head liquidity is really low. |
Hi, @cjdsellers. I am reading the documentation in https://nautilustrader.io/docs/latest/concepts/backtesting and I am not sure, whether Will it start working if it is enabled? |
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
In the given folder, there is a strategy, its output and data to run on.
It opens two limit orders with the same price.
Expected Behavior
Only the first limit order sent is being filled.
Actual Behavior
Both limit orders are being filled at once from the same liquidity.
Steps to Reproduce the Problem
./strategy.py >strategy.out 2>&1
less strategy.out
Specifications
Additional notes
The text was updated successfully, but these errors were encountered: