예제 #1
0
파일: CGateFeed.cs 프로젝트: euvgub/Polygon
        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;
        }
예제 #2
0
        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 };
        }
예제 #3
0
 public CGateInstrumentParamsEmitter(CGateInstrumentResolver instrumentResolver)
 {
     this.instrumentResolver = instrumentResolver;
     sessionEndTime          = TimeSpan.FromDays(1);
 }
예제 #4
0
 public CGateOrderBookEmitter(string streamName, CGateInstrumentResolver instrumentResolver)
 {
     this.streamName         = streamName;
     this.instrumentResolver = instrumentResolver;
 }