public CGateFeed( ICGAdapter cgAdapter, CGateInstrumentResolver instrumentResolver, CGateInstrumentParamsEmitter instrumentParamsEmitter) { this.cgAdapter = cgAdapter; this.cgAdapter.MarketdataMessageReceived += CGateAdapterStreamMessageHandler; this.instrumentResolver = instrumentResolver; this.instrumentParamsEmitter = instrumentParamsEmitter; futOrderBookEmitter = new CGateOrderBookEmitter("FORTS_FUTAGGR20_REPL", instrumentResolver); futOrderBookEmitter.OrderBookUpdated += orderBookEmitter_OrderBookUpdated; optOrderBookEmitter = new CGateOrderBookEmitter("FORTS_OPTAGGR20_REPL", instrumentResolver); optOrderBookEmitter.OrderBookUpdated += orderBookEmitter_OrderBookUpdated; instrumentResolver.OnNewIsinResolved += CGateIsinResolverOnNewIsinResolved; }
public CGateConnector(CGateParameters settings, string dataFolder) { this.settings = settings; var config = settings.ToCGAdapterConfiguration(); if (!settings.IsTestConnection) { config.Key = settings.P2Key; } config.Logger = new CGateLogger(); config.IniFolder = @"scheme\"; cgAdapter = new CGP2ClientAdapter(config, Path.Combine(dataFolder, "cgate"), openOrderBooksStreams: settings.OrderBooksEnabled); cgAdapter.ConnectionStateChanged += CGAdapterConnectionStateChangedHandler; instrumentIsinResolver = new CGateInstrumentResolver(settings.InstrumentConverter); instrumentParamsEmitter = new CGateInstrumentParamsEmitter(instrumentIsinResolver); feed = new CGateFeed(cgAdapter, instrumentIsinResolver, instrumentParamsEmitter); router = new CGateRouter(cgAdapter, instrumentIsinResolver, instrumentParamsEmitter); ConnectionStatusProviders = new IConnectionStatusProvider[] { this }; }
public CGateInstrumentParamsEmitter(CGateInstrumentResolver instrumentResolver) { this.instrumentResolver = instrumentResolver; sessionEndTime = TimeSpan.FromDays(1); }
public CGateOrderBookEmitter(string streamName, CGateInstrumentResolver instrumentResolver) { this.streamName = streamName; this.instrumentResolver = instrumentResolver; }