Market Replay for testing? #72
Replies: 2 comments 5 replies
-
Replay Differences
So for replay: Engine Code Solution We can add a bool to allow handling for that context in replay etc Ok have made a simple change to main- added See commit: 29df98a |
Beta Was this translation helpful? Give feedback.
-
we will need to leave this open and wait for test feedback - in case this has broken something else when execution goes into the new section instead of returning :-) |
Beta Was this translation helpful? Give feedback.
-
I typically use Market Replay as part of my strategy testing, prior to live simulation, to make sure things behave as expected WRT order flow and error handling.
For the life of me I could not figure out why stop order rejections were not being handled (cancel orders, close position) when using Replay. Rather, if an error occurred in one or all stop orders, I'd end up with a bunch of targets, or neither stops or targets and an open position.
Then I spotted in OnOrderUpdate,
if (Playback) return;
prior to any of the order.OrderState case checking and order addition / removal from the Orders List
Why is there "if (Playback) return;" in OnOrderUpdate? Is there something about replay that negates it from being a valid way to check this frameworks behavior? I note elsewhere in the code less invocation of the workflow engine with with checking around IsHistoricalTradeOrPlayBack. I suspect that there some limitation of Replay that I don't yet understand?
BTW: When I removed the if (Playback) return; everything seemed to be handled as expected, much more gracefully! :-)
Beta Was this translation helpful? Give feedback.
All reactions