-
Fixes Insight Period Calculation (#6978)
发布于
2023-02-20 19:23:13 +00:00 | 1587 次提交 在此版本后已推送到 masterThe calculations of
CloseTimeUtcare correct and consistent: if the exchange is closed when the insight expires,CloseTimeUtcis the next open.However, the definition of the
Periodwas not consistent. Normally, it is defined by the different betweenCloseTimeUtcandGeneratedTimeUtc, 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
ComputePeriodmethod enforced consistency between the Resolution and bar Count overload and theDateTimeoverload, so the period for this overload was also incorrect.下载附件