Пример #1
0
        private void PlanEodJob(DateTime operatingIntervalStart, DateTime operatingIntervalEnd, DateTime currentDateTime)
        {
            var eodTime = operatingIntervalStart.AddMinutes(_overnightMarginSettings.ActivationPeriodMinutes);

            if (currentDateTime < eodTime)
            {
                JobManager.AddJob(() => _tradingEngine.ProcessExpiredOrders(operatingIntervalEnd),
                                  (s) => s.NonReentrant().ToRunOnceAt(eodTime));
            }
            else
            {
                JobManager.AddJob(() => _tradingEngine.ProcessExpiredOrders(operatingIntervalEnd),
                                  (s) => s.ToRunNow());
            }
        }