发布

  • 9841 0f0a2bc9a8

    Fixes weeklies parsing, causing certain futures to be inaccessible in QCAlgorithm (#4936)

    frostbyte_neo 发布于 2020-11-20 14:58:49 +00:00 | 2712 次提交 在此版本后已推送到 master

    • Fixes weeklies parsing, causing certain futures to be inaccessible in Algorithm

      The FuturesExpiryFunction expects the contract month of the Future,
      not the expiration. As a result, the contract gets filtered as a
      weekly contract, rather than as a standard due to the discrepancy
      between the expiry dates when the contract month differs from the
      expiry date's month.

      A very important fact to note is that futures can and do expire prior
      to the contract month. BZ,(brent crude financial futures) expire two
      months prior to the contract month, CL one month prior, etc.

      There has been an addition that contains a "reverse" futures expiry function
      lookup table. We use this to lookup the contract month to re-calculate
      the Future expiry.

      This PR also fixes dairy and adds extra expiry dates. Dairy can have
      an expiry after the contract month, so a new path was added to the
      SymbolRepresentation to ensure that these contracts are loaded
      correctly.

    • Address review: Adds tests and fixes bug in SymbolRepresentation

      • Updates SID comment on Date property to reflect fact that we use
        future expiry for its value

      • Fixes bug in SymbolRepresentation where expiration day would always
        be 01 when parsing a contract with an expiration after the contract
        month

      • Fixes bug in SybmolRepresentation where expiration year would be
        four digits long when parsing a contract with an expiration after
        the contract month

      • Fixes some bad dairy expiry dates

      • Adds tests for SymbolRepresentation and the futures filtering for
        standard contracts

      • Renames method used to extract delta between contract month and
        expiry date

    • Removes GH comment and restores Futures contract month expiry param

    下载附件