forked from QuantConnect/Lean
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Market On Open Fill of Equity Fill Model (QuantConnect#5679)
* Fixes Market On Open Fill of Equity Fill Model Only use trade data (Tick with Trade type or TradeBar) to get the open price, since MOO is filled with the opening action price. Ensure that this method doesn't use trade data from before the market opens for high-resolution data case. Fix unit tests to show that the new implementation only fills with trade data from the current open market. Change regression tests to reflect the bug fix. In the `ExtendedMarketHoursHistoryRegressionAlgorithm`, MOO was filled with extended market hours. * Fix Bug for Tick Resolution Case For tick susbcription, the tick with the open price information is the the first valid (non-zero) tick of trade type from an open market. Addresses peer-review by moving the if-condition for data belonging to the open market where the subscriscribed types are checked. * Fix Bug for Low Resolution Edge Case For the edge case where the order is placed after the trade bar is open, for example, order places at 1 pm with daily-resolution data. The fill model will not use the open of the bar that will close at midnight, since this value is prior to the order. Adds unit test. Change regression tests to reflect the bug fix. In the `RegressionAlgorithm`, MOO was filled with open prior to the order. The algorithm now has one order less, since the last MOO would need to wait another day to be filled. * Implements SaleCondition and Exchange Check For Tick - Adds additional unit tests for MOO * Fixes Regression Test in DataConsolidatorPythonWrapperTests * Addresses Peer-Review - Adds new unit test cases.
- Loading branch information
1 parent
1a02fba
commit 9b7af08
Showing
8 changed files
with
354 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.