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

            adapter.TimeBarReportReceived += TimeBarReportReceived;
        }
Beispiel #2
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);
        }
Beispiel #3
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;
        }
Beispiel #4
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;
        }
Beispiel #5
0
            public InstrumentSubscription(
                CQGCInstrumentResolver instrumentResolver,
                Instrument instrument,
                uint contractId)
            {
                this.instrumentResolver = instrumentResolver;
                Instrument = instrument;
                lockCookie = DeadlockMonitor.Cookie <InstrumentSubscription>("lockCookie-" + ContractId);
                ContractId = contractId;

                InstrumentParams = new InstrumentParams {
                    Instrument = instrument
                };
                InstrumentParams.VolaTranslatedByFeed = false;
                OrderBook = new OrderBook();
            }