private void DealTimeInfo() { if (mainKLineData.IsTradingPeriodStart(mainKLineData.BarPos)) { isTradingTimeStart = true; } else { isTradingTimeStart = false; } if (mainKLineData.IsTradingPeriodEnd(mainKLineData.BarPos)) { isTradingTimeEnd = true; } else { isTradingTimeEnd = false; } if (mainKLineData.IsDayStart(mainKLineData.BarPos)) { isDayStart = true; } else { isDayStart = false; } if (mainKLineData.IsDayEnd(mainKLineData.BarPos)) { isDayEnd = true; } else { isDayEnd = false; } }
private static int GetStartTickIndex(IKLineData_RealTime klineData_RealTime, ITickData_Extend tickData, KLinePeriod klinePeriod, int klineIndex) { int startTickIndex; if (klinePeriod.PeriodType == KLineTimeType.DAY) { startTickIndex = 0; } else { double klineTime = klineData_RealTime.BarPos == klineIndex?klineData_RealTime.GetCurrentBar_Original().Time : klineData_RealTime.Arr_Time[klineIndex]; startTickIndex = TimeIndeierUtils.IndexOfTime_Tick(tickData, klineTime, true); if (klineData_RealTime.IsTradingPeriodStart(klineIndex)) { while (!tickData.IsTradingTimeStart(startTickIndex)) { startTickIndex--; } } } return(startTickIndex); }