示例#1
0
        public void OnMessage(MarketDataIncrementalRefresh message, SessionID session)
        {
            var noMdEntries     = message.NoMDEntries;
            var listOfMdEntries = noMdEntries.getValue();
            //message.GetGroup(1, noMdEntries);
            var group = new MarketDataIncrementalRefresh.NoMDEntriesGroup();

            Group gr = message.GetGroup(1, group);

            string sym = message.MDReqID.getValue();

            var price = new MarketPrice();


            for (int i = 1; i <= listOfMdEntries; i++)
            {
                group = (MarketDataIncrementalRefresh.NoMDEntriesGroup)message.GetGroup(i, group);

                price.Symbol = group.Symbol.getValue();

                MDEntryType mdentrytype = group.MDEntryType;

                if (mdentrytype.getValue() == '0') //bid
                {
                    decimal px = group.MDEntryPx.getValue();
                    price.Bid = px;
                }
                else if (mdentrytype.getValue() == '1') //offer
                {
                    decimal px = group.MDEntryPx.getValue();
                    price.Offer = px;
                }

                price.TimeStamp = group.MDEntryTime.ToString();
            }

            if (OnMarketDataIncrementalRefresh != null)
            {
                OnMarketDataIncrementalRefresh(price);
            }
        }
示例#2
0
 private void Client_OnMarketDataSnapshotFullRefresh(MarketPrice obj)
 {
     AddItem(obj.ToString());
 }
示例#3
0
 private void Client_OnMarketDataIncrementalRefresh(MarketPrice obj)
 {
     AddItem(obj.ToString());
 }