Skip to content

Orders not being filled in backtest #1168

Closed Answered by benjaminsingleton
benjaminsingleton asked this question in Q&A
Discussion options

You must be logged in to vote

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!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cjdsellers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
1 participant