发布

  • 15145 7cc6e31c43

    Fixes Insight Period Calculation (#6978)

    frostbyte_neo 发布于 2023-02-20 19:23:13 +00:00 | 1587 次提交 在此版本后已推送到 master

    The calculations of CloseTimeUtc are correct and consistent: if the exchange is closed when the insight expires, CloseTimeUtc is the next open.

    However, the definition of the Period was not consistent. Normally, it is defined by the different between CloseTimeUtc and GeneratedTimeUtc, but when we create an Insight with the Resolution and bar count overload, the period was defined by them:

    insight.Period = Resolution.ToTimeSpan().Multiply(BarCount);
    

    which is incorrect, since it doesn't take the days the exchange is closed into account. The ComputePeriod method enforced consistency between the Resolution and bar Count overload and the DateTime overload, so the period for this overload was also incorrect.

    下载附件