//private void initIpoDates() //{ // List<CodeInfo> codes = this.codeInfoGenerator.GetAllOldCodes(); // for (int i = 0; i < codes.Count; i++) // { // string code = codes[i].Code; // dic_OldCodeId_IpoDate.Add(code, GetIpoDateInternal(code)); // } //} //private int GetIpoDateInternal(string oldCodeId) //{ // ITradingDayReader reader = this.dataprovider_TradingDay.GetTradingDayReader(); // List<int> tradingDays = reader.GetAllTradingDays(); // for (int i = 0; i < tradingDays.Count; i++) // { // int date = tradingDays[i]; // string path = GetOldCodePath(oldCodeId, date); // if (File.Exists(path)) // return date; // } // return -1; //} //private String GetOldCodePath(String code, int date) //{ // return srcDataPath + "\\" + codeInfoGenerator.DataLoader_CodeInfo.GetBelongMarket(code) + "\\" + date + "\\" + code + "_" + date + ".csv"; //} //private int GetIpoDate(String oldCodeId) //{ // Init(); // if (dic_OldCodeId_IpoDate.ContainsKey(oldCodeId)) // return dic_OldCodeId_IpoDate[oldCodeId]; // return -1; //} #region 获得tickdata public ITickData LoadTickData(string code, int date) { TickDataAdjuster tickDataAdjuster = new TickDataAdjuster(); TickData tickData = LoadOriginalTickData(code, date); if (tickData == null) { return(null); } tickDataAdjuster.Adjust(tickData, dataLoader_TradingSessionDetail.GetTradingTime(code, date)); return(tickData); }
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); }