Backtesting: what happens to real-executed order if mine fills instead?

Backtesting: what happens to real-executed order if mine fills instead?

Manage alerts

Loading saved threads...

user997112 · External communityPost link
External question — Quantitative Finance Stack Exchange Author: user997112 Original post: https://quant.stackexchange.com/questions/37080 License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I'm writing a backtester and using an order-by-order Nasdaq ITCH feed whilst testing it. Let's say the bid-ask spread is 100 @ 9-11 @ 100 My strategy inserts an bid order for 100 @ 10 and this becomes the new best bid. I continue parsing the ITCH feed and I see that the 100 @ 9 has traded. This implies had I really placed a bid for 10, that would have traded now. So instead of removing the bid at 9, I remove my own order and notify my strategy that we were just filled. However, in reality the bid at 9 disappeared and therefore ITCH would never send another message (i.e. cancel) for it because as far as they're concerned, it no longer exists. Therefore I am stuck with this order in the book, which actually shouldn't be there. Is this situation unavoidable in a backtesting simulation? Or is there something I can/should do?
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Quantitative Finance Stack Exchange Author: user997112 Source score (net votes, not local likes): 5 Original post: https://quant.stackexchange.com/questions/37080 License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I'm writing a backtester and using an order-by-order Nasdaq ITCH feed whilst testing it. Let's say the bid-ask spread is 100 @ 9-11 @ 100 My strategy inserts an bid order for 100 @ 10 and this becomes the new best bid. I continue parsing the ITCH feed and I see that the 100 @ 9 has traded. This implies had I really placed a bid for 10, that would have traded now. So instead of removing the bid at 9, I remove my own order and notify my strategy that we were just filled. However, in reality the bid at 9 disappeared and therefore ITCH would never send another message (i.e. cancel) for it because as far as they're concerned, it no longer exists. Therefore I am stuck with this order in the book, which actually shouldn't be there. Is this situation unavoidable in a backtesting simulation? Or is there something I can/should do?

Cancel quote

Checking account access…