Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleManager"/> class
        /// </summary>
        /// <param name="securities">Securities manager containing the algorithm's securities</param>
        /// <param name="timeZone">The algorithm's time zone</param>
        public ScheduleManager(SecurityManager securities, DateTimeZone timeZone)
        {
            _securities = securities;
            DateRules = new DateRules(securities);
            TimeRules = new TimeRules(securities, timeZone);

            // used for storing any events before the event schedule is set
            _preInitializedEvents = new List<ScheduledEvent>();
        }
Esempio n. 2
0
 private static DateRules GetDateRules()
 {
     var timeKeeper = new TimeKeeper(DateTime.Today, new List<DateTimeZone>());
     var manager = new SecurityManager(timeKeeper);
     var securityExchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(Market.USA, null, SecurityType.Equity);
     var config = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, true, false, false);
     manager.Add(Symbols.SPY, new Security(securityExchangeHours, config, new Cash(CashBook.AccountCurrency, 0, 1m), SymbolProperties.GetDefault(CashBook.AccountCurrency)));
     var rules = new DateRules(manager);
     return rules;
 }
Esempio n. 3
0
 private static DateRules GetDateRules()
 {
     var timeKeeper = new TimeKeeper(DateTime.Today, new List<DateTimeZone>());
     var manager = new SecurityManager(timeKeeper);
     var securityExchangeHours = SecurityExchangeHoursProvider.FromDataFolder().GetExchangeHours("usa", null, SecurityType.Equity);
     var config = new SubscriptionDataConfig(typeof(TradeBar), SecurityType.Equity, "SPY", Resolution.Daily, "usa", TimeZones.NewYork, true, false, true, true, false);
     manager.Add("SPY", new Security(securityExchangeHours, config, 1, false));
     var rules = new DateRules(manager);
     return rules;
 }