public CQGCInstrumentHistoryProvider(CQGCAdapter adapter, CQGCInstrumentResolver instrumentResolver)
        {
            this.adapter            = adapter;
            this.instrumentResolver = instrumentResolver;

            adapter.TimeBarReportReceived += TimeBarReportReceived;
        }
Example #2
0
        public CQGCInstrumentResolver(
            CQGCAdapter adapter,
            InstrumentConverter <InstrumentData> instrumentConverter)
        {
            this.adapter = adapter;

            this.adapter.MarketDataResolved       += MarketDataResolved;
            this.adapter.MarketDataNotResolved    += MarketDataNotResolved;
            this.adapter.ContractMetadataReceived += ContractMetadataReceived;

            InstrumentConverter = instrumentConverter;

            requestBatchTimer = new Timer(_ => SendBatchRequest(), null, 0, RequestBatchTimerInterval);
        }
Example #3
0
        public CQGCFeed(
            CQGCAdapter adapter,
            CQGCInstrumentResolver instrumentResolver)
        {
            this.adapter            = adapter;
            this.instrumentResolver = instrumentResolver;

            adapter.MarketDataResolved                   += MarketDataResolved;
            adapter.RealTimeMarketDataReceived           += RealTimeMarketDataReceived;
            adapter.MarketDataSubscriptionStatusReceived += MarketDataSubscriptionStatusReceived;
            adapter.ContractMetadataReceived             += ContractMetadataReceived;

            requestBatchTimer = new Timer(_ => SendBatchRequest(), null, 0, RequestBatchTimerInterval);
        }
Example #4
0
        /// <summary>
        ///     Конструктор
        /// </summary>
        public CQGCConnector(
            CQGCParameters settings)
        {
            this.settings = settings;
            adapter       = new CQGCAdapter(settings);
            var instrumentResolver = new CQGCInstrumentResolver(adapter, settings.InstrumentConverter);

            feed                      = new CQGCFeed(adapter, instrumentResolver);
            router                    = new CQGCRouter(adapter, instrumentResolver);
            historyProvider           = new CQGCInstrumentHistoryProvider(adapter, instrumentResolver);
            ConnectionStatusProviders = new IConnectionStatusProvider[] { this };

            adapter.ConnectionStatusChanged += AdapterConnectionStatusChanged;
            adapter.UserMessageReceived     += UserMessageReceived;
        }
Example #5
0
        public CQGCRouter(CQGCAdapter adapter, CQGCInstrumentResolver instrumentResolver)
        {
            this.adapter            = adapter;
            this.instrumentResolver = instrumentResolver;

            dispatcher = new TransactionDispatcher(this);

            this.adapter.AccountResolved                 += AccountResolved;
            this.adapter.PositionStatusReceived          += PositionStatusReceived;
            this.adapter.TradeSnapshotCompletionReceived += TradeSnapshotCompletionReceived;
            this.adapter.TradeSubscriptionStatusReceived += TradeSubscriptionStatusReceived;
            this.adapter.OrderStatusReceived             += OrderStatusReceived;
            this.adapter.CollateralStatusReceived        += CollateralStatusReceived;
            this.adapter.OrderRequestRejectReceived      += OrderRequestRejectReceived;
            instrumentResolver.InstrumentResolved        += InstrumentResolved;
        }