public void reqHistDataIfValid(DateTime current, String whatToShow, Contract contract) { DateTime rtbDataStartTime = appMDManager.getRtbDataStartTime(); //DateTime histDataEndTime = rtbDataStartTime.AddMinutes(-1); DateTime histReqProcessTime = rtbDataStartTime.AddSeconds(30); //appMDManager.setHistDataEndTime(histDataEndTime); if (current >= histReqProcessTime && isReqHistDataSent == false && needMergeFlag) { //string whatToShow = parentUI.GetWTS(); string strEndTime = String.Format("{0:yyyyMMdd HH:mm:ss}", rtbDataStartTime) + " HKT"; string duration = "1 D"; string barSize = "1 min"; int outsideRTH = 1; //use regular trading hour IIBTradeAppBridge parentUI = appMDManager.getParentUI(); TickerInfo info = appMDManager.tickerInfo; //*** 2015-12-09 big change*** //parentUI.addHistDataRequest(contract, strEndTime, duration, barSize, info.whatToShow, 1); parentUI.addHistDataRequest(contract, strEndTime, duration, barSize, whatToShow, 1); isReqHistDataSent = true; isReqHistDataSent = true; } }