예제 #1
0
        protected OptionsPlayTask(ISchedulerCoreService schedulerCoreService, SchedulerTask schedulerTask)
        {
            SchedulerCoreService = schedulerCoreService;

            EntityResponse <SchedulerTask> response = SchedulerCoreService.CreateTaskDefinitionIfNotExists(schedulerTask);

            SchedulerTask = response.Entity;
        }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
        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;
        }
예제 #5
0
 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;
 }
예제 #6
0
        // 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());
            }
        }
예제 #7
0
 public QueueWatcherJob(ISchedulerCoreService schedulerCoreService)
 {
     _schedulerCoreService = schedulerCoreService;
 }