Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubscriptionRequest"/> class
        /// </summary>
        public SubscriptionRequest(bool isUniverseSubscription,
                                   Universe universe,
                                   Security security,
                                   SubscriptionDataConfig configuration,
                                   DateTime startTimeUtc,
                                   DateTime endTimeUtc)
            : base(startTimeUtc, endTimeUtc, security.Exchange.Hours, configuration.TickType)
        {
            IsUniverseSubscription = isUniverseSubscription;
            Universe      = universe;
            Security      = security;
            Configuration = configuration;

            // open interest data comes in once a day before market open,
            // make the subscription start from midnight and use always open exchange
            if (Configuration.TickType == TickType.OpenInterest)
            {
                StartTimeUtc = StartTimeUtc.ConvertFromUtc(ExchangeHours.TimeZone).Date.ConvertToUtc(ExchangeHours.TimeZone);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubscriptionRequest"/> class
        /// </summary>
        public SubscriptionRequest(bool isUniverseSubscription,
                                   Universe universe,
                                   Security security,
                                   SubscriptionDataConfig configuration,
                                   DateTime startTimeUtc,
                                   DateTime endTimeUtc)
        {
            IsUniverseSubscription = isUniverseSubscription;
            Universe      = universe;
            Security      = security;
            Configuration = configuration;

            // open interest data comes in once a day before market open,
            // make the subscription start from midnight
            StartTimeUtc = configuration.TickType == TickType.OpenInterest ?
                           startTimeUtc.ConvertFromUtc(Configuration.ExchangeTimeZone).Date.ConvertToUtc(Configuration.ExchangeTimeZone) :
                           startTimeUtc;

            EndTimeUtc = endTimeUtc;

            _localStartTime = new Lazy <DateTime>(() => StartTimeUtc.ConvertFromUtc(Configuration.ExchangeTimeZone));
            _localEndTime   = new Lazy <DateTime>(() => EndTimeUtc.ConvertFromUtc(Configuration.ExchangeTimeZone));
        }