コード例 #1
0
        public InstrumentParams GetUpdatedInstrumentParams(CGateAdapter.Messages.FutCommon.CgmCommon message)
        {
            var ip = GetUpdatedInstrumentParams(message.IsinId);

            if (ip == null)
            {
                return(null);
            }

            ip.BestOfferPrice    = (decimal)message.BestSell;
            ip.BestBidPrice      = (decimal)message.BestBuy;
            ip.BestOfferQuantity = message.AmountSell;
            ip.BestBidQuantity   = message.AmountBuy;
            ip.LastPrice         = (decimal)message.Price; //last
            // message.Amount;//last qty
            // message.deal_time;//last time
            // message.max_price;//
            // message.min_price;
            // message.open_price;

            if (string.IsNullOrEmpty(ip.Instrument.Code))
            {
                return(null);
            }

            return(ip.Clone());
        }
コード例 #2
0
ファイル: CGateFeed.cs プロジェクト: euvgub/Polygon
        public override void Handle(CGateAdapter.Messages.FutCommon.CgmCommon message)
        {
            var code = instrumentResolver.GetShortIsinByIsinId(message.IsinId);

            if (string.IsNullOrEmpty(code))
            {
                EnqueuePendingMessage(message);
                return;
            }

            var ip = instrumentParamsEmitter.GetUpdatedInstrumentParams(message);

            if (ip != null)
            {
                EnqueueTransportMessage(ip);
            }
        }