发布

  • 15186 8bcd588602

    Fixes EquityFillModel.FillModel (#7005)

    frostbyte_neo 发布于 2023-02-24 13:35:34 +00:00 | 1572 次提交 在此版本后已推送到 master

    • Adds Unit Tests

    The LimitFill method should not fill using QuoteBar or Tick with TickType.Quote type.
    Adds missing test for tick data (TickType.Trade).

    • Fixes EquityFillModel.FillModel

    Use Tick with TickType.Trade or TradeBar information to fill limit orders.

    • Update Regression Test Expected Statistics

    The regression tests changed because of different fills.
    The ExtendedMarketTradingRegressionAlgorithm has different number of trades because of an extra fill on the 4th order generated by TradeBar with a Low lower than than the QuoteBar.Ask Low:

    20230222 13:56:24.251 TRACE:: Log: Time: 10/10/2013 12:01:00 OrderID: 4 EventID: 2 Symbol: SPY Status: Filled Quantity: 10 FillQuantity: 10 FillPrice: 143.8998 USD

    asset.Cache.GetData().ToString()
    "SPY: Bid: O: 144.2457 Bid: H: 144.2629 Bid: L: 144.2457 Bid: C: 144.2629 Ask: O: 144.2543 Ask: H: 144.2889 Ask: L: 144.2543 Ask: C: 144.2889 "

    asset.Cache.GetData().ToString()
    "SPY: O: 144.2543 H: 144.4532 L: 143.4156 C: 144.2716 V: 75423"

    • Improves Tick Resolution Unit Test

    • Fixes Tick Resolution Case Handling

    master only considers the latest trade, missing possible fills in the batch of trades.

    • Adds Unit Test for Gap

    See https://github.com/QuantConnect/Lean/issues/963

    • Addresses Fill Optimistic Assumption

    If we have a bar that gaps in our favor, we accept the limit price to avoid optimitic fills.

    • Fixes Regression Tests

    All regression tests with limit orders have worst performance after we remove the optimitic assumption, and use the limit price instead.

    下载附件