예제 #1
0
        /// <summary>
        /// Sends Historical bar data request to Market Data Server
        /// </summary>
        /// <param name="security">Contains symbol information</param>
        /// <param name="barDetail">Contains parameter information for the historical bars to be fetched</param>
        /// <param name="providerName">Name of the provider on which to subscribe</param>
        public void SubscribeHistoricalData(Security security, HistoricalBarParameters barDetail, string providerName)
        {
            // Create bar subscription message
            HistoricDataRequest subscribe =
                SubscriptionMessage.HistoricDataSubscription(_idGenerator.NextHistoricalDataId(), security,
                                                             barDetail.StartDate, barDetail.EndDate, barDetail.Interval, barDetail.Type, providerName);

            _historicalDataService.Subscribe(subscribe);
        }
예제 #2
0
        /// <summary>
        /// Sends request to retrieve historical bar data
        /// </summary>
        /// <param name="id">Unique ID to distinguish the request</param>
        /// <param name="security">Contains symbol information</param>
        /// <param name="startTime">Time from which to start the historical bar data</param>
        /// <param name="endTime">Time at which the historical bar data should end</param>
        /// <param name="interval">Bar interval</param>
        private void RequestHistoricalBarData(string id, Security security, DateTime startTime, DateTime endTime, uint interval)
        {
            // Create Historical Bar request message
            HistoricDataRequest historicBarDataRequest = SubscriptionMessage.HistoricDataSubscription(id, security,
                                                                                                      startTime, endTime, interval, BarPriceType.LAST, _historicalDataProvider);

            // Send historical bar request
            this.Subscribe(historicBarDataRequest);
        }