public DataProvider_Appoint(string pluginPath) { dataProvider1 = new DataProvider_BiaoPuYongHua(SRCPATH1, pluginPath); dataProvider2 = new DataProvider_JinShuYuan(SRCPATH2, pluginPath); dataProvider3 = new DataProvider_Daily(SRCPATH3, pluginPath); InitAllCodes(); InitAllDates(); string path = pluginPath + "\\config\\appoint"; string[] appoints = File.ReadAllLines(path); for (int i = 0; i < appoints.Length; i++) { string str = appoints[i]; if (str == "") { continue; } string[] arr = str.Split(','); //没有K线的情况暂时不处理 if (arr[2] == "0" || arr[2] == "2") { continue; } AppointUpdate ap = new AppointUpdate(); ap.Code = arr[0]; ap.Date = int.Parse(arr[1]); this.appointUpdates.Add(ap); } }
private List <IStep> GetAllStep_UpdateAppoint() { List <IStep> steps = new List <IStep>(); //更新一次所有开盘时间 //List<CodeInfo> allCodes = dataUpdateHelper.GetAllCodes(); //GetTradingTime(steps, allCodes, true); List <AppointUpdate> aps = dataProvider.GetAppointUpdate(); for (int i = 0; i < aps.Count; i++) { AppointUpdate ap = aps[i]; string code = ap.Code; int date = ap.Date; CodeInfo codeInfo = dataUpdateHelper.GetCodeInfo(code); if (ap.UpdateTick) { Step_TickData_CodeDate step = new Step_TickData_CodeDate(dataUpdateHelper, codeInfo, date, true); steps.Add(step); } if (ap.UpdateKLine) { //int prevDate = dataUpdateHelper.GetNewTradingDayCache().GetPrevTradingDay(date); //ITickData newTickData = dataUpdateHelper.GetNewTickData(code, prevDate); //if (newTickData == null) { // continue; //} //float lastEndPrice = newTickData.Arr_Price[newTickData.Length - 1]; //int lastEndHold = newTickData.Arr_Hold[newTickData.Length - 1]; float lastEndPrice = -1; int lastEndHold = -1; Step_KLineData_OneDay step = new Step_KLineData_OneDay(dataUpdateHelper, codeInfo, ap.Date, KLinePeriod.KLinePeriod_1Minute, lastEndPrice, lastEndHold, true); steps.Add(step); } } return(steps); }