protected OptionsPlayTask(ISchedulerCoreService schedulerCoreService, SchedulerTask schedulerTask) { SchedulerCoreService = schedulerCoreService; EntityResponse <SchedulerTask> response = SchedulerCoreService.CreateTaskDefinitionIfNotExists(schedulerTask); SchedulerTask = response.Entity; }
public ErasePerMinuteQuotesPopulatingTask(ISchedulerCoreService schedulerCoreService, IMarketDataPopulatorService marketDataPopulatorService) : base(schedulerCoreService, new SchedulerTask { CronExpression = Configuration.ErasePerMinuteQuotesPopCronExpression, Description = "Erase Per Minute Quotes Populating", Name = "Erase Per Minute Quotes Populating", Type = SchedulerTaskType.ErasePerMinuteQuotesPopulating }) { _marketDataPopulatorService = marketDataPopulatorService; }
public LatestStockQuotesToHistoricalQuotesPerDayPopulatingTask(ISchedulerCoreService schedulerCoreService, IMarketDataPopulatorService marketDataPopulatorService) : base(schedulerCoreService, new SchedulerTask { CronExpression = Configuration.LatestStockQuotesToHistoricalQuotesPerDayPopCronExpression, Description = "Latest StockQuotes To HistoricalQuotes Per Day Populating", Name = "Latest StockQuotes To HistoricalQuotes Per Day Populating", Type = SchedulerTaskType.LatestStockQuotesToHistoricalQuotesPerDayPopulating }) { _marketDataPopulatorService = marketDataPopulatorService; }
public RealTimeQuotesPopulatingTask(ISchedulerCoreService schedulerCoreService, IMarketDataPopulatorService marketDataPopulatorService) : base(schedulerCoreService, new SchedulerTask { CronExpression = Configuration.RealTimeQuotesPopCronExpression, Description = "Real Time Quotes Populating", Name = "Real Time Quotes Populating", Type = SchedulerTaskType.RealTimeQuotesPopulating }) { //Logger.Debug("Real Time Quotes " + Configuration.RealTimeQuotesPopCronExpression); _marketDataPopulatorService = marketDataPopulatorService; }
public TradeIdeasPopulatingTask( ITradeIdeaService tradeIdeaService, ISchedulerCoreService schedulerCoreService) : base(schedulerCoreService, new SchedulerTask { CronExpression = "0 0 2 ? * TUE-SAT *", Description = "Trade Ideas Populating", Name = "Trade Ideas Populating", Type = SchedulerTaskType.TradeIdeasPopulating, LockerMask = GetLockerMaskFor(SchedulerTaskType.HistoricalQuotesPopulating) }) { _tradeIdeaService = tradeIdeaService; }
// See http://www.cronmaker.com/ //private const string CronString = "0 {1} {0} ? * MON,TUE,WED,THU,FRI *"; // {0} - hours, {1} - minutes private void UpdateTasksQueue() { ISchedulerCoreService schedulerCoreService = ObjectFactory.GetInstance <ISchedulerCoreService>(); List <OptionsPlayTask> syrahTraderTasks = new List <OptionsPlayTask>(); //Get all tasks from current assembly Type baseType = typeof(OptionsPlayTask); foreach (Type type in Assembly.GetAssembly(baseType).GetTypes()) { if (baseType.IsAssignableFrom(type) && type != baseType) { try { if (type != null) { Logger.Debug(type.ToString()); OptionsPlayTask instance = (OptionsPlayTask)ObjectFactory.GetInstance(type); syrahTraderTasks.Add(instance); } } catch (Exception ex) { Logger.Error("Error ", ex); } } } //Update db for tasks foreach (OptionsPlayTask task in syrahTraderTasks) { Logger.Debug(task.TaskType.ToString()); SchedulerQueue schedulerQueue = task.CreateSchedulerQueue(); schedulerCoreService.CreateQueueTask(schedulerQueue, true); Logger.Debug(task.TaskType.ToString()); } }
public QueueWatcherJob(ISchedulerCoreService schedulerCoreService) { _schedulerCoreService = schedulerCoreService; }