public KLineDataCache_BigPeriod(IDataReader dataReader, string code, int startDate, int endDate, int beforeBarCount) { this.dataReader = dataReader; this.code = code; this.startDate = dataReader.TradingDayReader.GetNextTradingDay(startDate); this.endDate = endDate; this.beforeBarCount = beforeBarCount; this.tradingSessionReader = dataReader.CreateTradingSessionReader(code); }
private void InitDaySplitter(IDataReader dataReader, string code) { ITradingSessionReader_Instrument sessionReader = dataReader.CreateTradingSessionReader(code); this.dic_Period_DaySplitter = new Dictionary <KLinePeriod, KLineData_DaySplitter>(); foreach (KLinePeriod period in dic_Period_KLineData.Keys) { KLineData_RealTime klineData = dic_Period_KLineData[period]; KLineData_DaySplitter daySplitter = new KLineData_DaySplitter(klineData, sessionReader); dic_Period_DaySplitter.Add(period, daySplitter); } }
public KLineDataForward_BigPeriod(KLineData_RealTime mainKLineData, Dictionary <KLinePeriod, KLineData_RealTime> allKLineData, ITradingSessionReader_Instrument tradingSessionReader) : this(mainKLineData, allKLineData) { this.daySplitter = new KLineData_DaySplitter(mainKLineData, tradingSessionReader); this.daySplitter.NextDay(); this.daySplitter.NextDay(); }
public KLineData_DaySplitter(IKLineData klineData, ITradingSessionReader_Instrument tradingSessionReader) { this.results = DaySplitter.Split(klineData, tradingSessionReader); }