Orders not being filled in backtest #1168
-
When I run a backtest, I see plenty of Some example logs:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I resolved this issue by realizing that my bars had a volume quantity of 0, which caused the matching engine to not fill the order. See this line: https://github.com/nautechsystems/nautilus_trader/blob/master/nautilus_trader/backtest/matching_engine.pyx#L521 As an FYI for others who might encounter this issue, when fetching historical bars of crypto from Interactive Brokers, the value of -1 is returned for volume (apparently they don't have valid historical volumes ...), which I was coercing to a value of 0, so I could ingest the data and load it into the Catalog. Clearly, this led to problems with the matching engine, so make sure your bars have volume otherwise orders will not be filled! |
Beta Was this translation helpful? Give feedback.
I resolved this issue by realizing that my bars had a volume quantity of 0, which caused the matching engine to not fill the order. See this line: https://github.com/nautechsystems/nautilus_trader/blob/master/nautilus_trader/backtest/matching_engine.pyx#L521
As an FYI for others who might encounter this issue, when fetching historical bars of crypto from Interactive Brokers, the value of -1 is returned for volume (apparently they don't have valid historical volumes ...), which I was coercing to a value of 0, so I could ingest the data and load it into the Catalog. Clearly, this led to problems with the matching engine, so make sure your bars have volume otherwise orders will not be filled!