Esempio n. 1
0
 public void resetRTBRequest(IRealTimeBarsManagerBridge RTBManager)
 {
     if (AppConstant.USE_OUT_REGULAR_DATA)
     {
         RTBManager.ResetRequest(stgManager.ParentUI.GetMDContract(), stgManager.ParentUI.GetWTS(), false);
     }
     else
     {
         RTBManager.ResetRequest(stgManager.ParentUI.GetMDContract(), stgManager.ParentUI.GetWTS(), true);
     }
 }
Esempio n. 2
0
        public void handleResetRTBRequest(AppTimeEvent timeEvent)
        {
            //Contract contract = stgManager.CurrentContract;
            Contract contract = stgManager.ParentUI.GetMDContract();
            IRealTimeBarsManagerBridge RTBManager = stgManager.ParentUI.getRealTimeBarsManager();

            if (contract == null)
            {
                return;
            }
            if (RTBManager == null)
            {
                return;
            }

            TickerInfo tickerInfo     = stgManager.ParentUI.getTickerInfo();
            String     strStartTime   = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + tickerInfo.startTime;
            DateTime   startTime      = DateTime.ParseExact(strStartTime, "yyyyMMdd  HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            DateTime   startTime_from = startTime.AddMinutes(-3);
            DateTime   startTime_to   = startTime.AddMinutes(-2);

            if (timeEvent.eventTime > startTime_from && timeEvent.eventTime < startTime_to && !morningTimeRTBReset)
            {
                log.Info("Morning Reset RTBar Start.");
                resetRTBRequest(RTBManager);
                morningTimeRTBReset = true;
                log.Info("Morning Reset RTBar End.");
                return;
            }

            String   strLunchTime   = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + tickerInfo.lunchEndTime;
            DateTime lunchTime      = DateTime.ParseExact(strLunchTime, "yyyyMMdd  HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            DateTime lunchTime_from = lunchTime.AddMinutes(-3);
            DateTime lunchTime_to   = lunchTime.AddMinutes(-2);

            if (timeEvent.eventTime > lunchTime_from && timeEvent.eventTime < lunchTime_to && !lunchTimeRTBReset)
            {
                log.Info("Lunch Reset RTBar Start.");
                resetRTBRequest(RTBManager);
                lunchTimeRTBReset = true;
                log.Info("Lunch Reset RTBar End.");
                return;
            }
        }