/// <summary> /// 创建数据更新帮助类 /// </summary> /// <param name="updatedDataLoader">已更新数据读取器</param> /// <param name="dataProvider">新数据提供器</param> public DataUpdateHelper(string pluginPath, UpdatedDataLoader updatedDataLoader, IDataProvider dataProvider) { this.updatedDataPath = updatedDataLoader.GetUpdatedDataPath(); this.updatedDataLoader = updatedDataLoader; this.dataProvider = dataProvider; DataLoader_Variety dataLoader_Variety = new DataLoader_Variety(pluginPath); this.dataLoader_TradingSessionDetail = new DataLoader_TradingSessionDetail(pluginPath, dataLoader_Variety); this.dataLoader_Variety = new DataLoader_Variety(pluginPath); this.generator_Main = new DataGenerator_TickData_Main(this); this.generator_Index = new DataGenerator_TickData_Index(this); }
public ITickData GetTickData(string code, int date) { if (code.EndsWith("13")) { DataGenerator_TickData_Index gen = new DataGenerator_TickData_Index(dataLoader); return(gen.Generate(code.Substring(0, code.Length - 2), date)); } if (code.EndsWith("MI")) { DataGenerator_TickData_Main gen = new DataGenerator_TickData_Main(dataLoader); return(gen.Generate(code.Substring(0, code.Length - 2), date)); } TickDataAdjuster tickDataAdjuster = new TickDataAdjuster(); TickData tickData = GetOriginalTickData(code, date); if (tickData == null) { return(null); } tickDataAdjuster.Adjust(tickData, dataLoader.LoadTradingSessionDetail(code, date)); return(tickData); }