Skip to content
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

Fix OrderMatchingEngine processing by book type for quotes and deltas #1754

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

davidsblom
Copy link
Collaborator

…der books

Pull Request

When the strategy subscribes to both quote deltas and order book deltas, the matching engine applies both quotes as well as deltas to the order book which is incorrect.
In case of the Bybit venue, quote ticks are pushed at a higher frequency than deltas. Hence, some strategies would like to get the latest top of the book quotes, and also build indicators on top of the full order book.

The matching engine should use a L1_MBP order book when subscribing to both quotes and deltas, because the quotes are sent earlier introducing a lookahead bias.

Type of change

Delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

Locally running backtests

@cjdsellers
Copy link
Member

Agreed, this change is good when running a backtest with both quotes and deltas. We only want to apply the deltas conditionally for L2 and L3 books.

@cjdsellers cjdsellers changed the title Fix processing order book deltas by the matching engine for L1_MBP or… Fix OrderMatchingEngine processing by book type for quotes and deltas Jun 29, 2024
@cjdsellers cjdsellers merged commit 9876091 into develop Jun 29, 2024
9 checks passed
@cjdsellers cjdsellers deleted the fix_matching_engine branch June 29, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants