当前位置: 首页>>代码示例>>C#>>正文


C# QuickFix.GetField方法代码示例

本文整理汇总了C#中QuickFix.GetField方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.GetField方法的具体用法?C# QuickFix.GetField怎么用?C# QuickFix.GetField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QuickFix的用法示例。


在下文中一共展示了QuickFix.GetField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: posTableUpdate

        /// <summary>
        /// Helper Method to process data from message for updating positions
        /// </summary>
        /// <param name="message"></param>
        /// <param name="session"></param>
        private void posTableUpdate(QuickFix.FIX42.Message message, SessionID session)
        {
            string MGT = null;
            string acct = null;

            string SecEx = null;
            string symbol = null;
            string secID = null;
            string gateway = null;

            int tradesize = 0;
            char side = char.MinValue;
            decimal price = 0.00M;

            bool OK2Update = true;

            try
            {
                QuickFix.Fields.SenderSubID subID = new QuickFix.Fields.SenderSubID();
                if (message.Header.IsSetField(subID))
                {
                    MGT = message.Header.GetField(subID).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.Account a = new QuickFix.Fields.Account();
                if (message.IsSetField(a))
                {
                    acct = message.GetField(a).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.SecurityExchange se = new QuickFix.Fields.SecurityExchange();
                if (message.IsSetField(se))
                {
                    SecEx = message.GetField(se).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.Symbol s = new QuickFix.Fields.Symbol();
                if (message.IsSetField(s))
                {
                    symbol = message.GetField(s).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.SecurityID sid = new QuickFix.Fields.SecurityID();
                if (message.IsSetField(sid))
                {
                    secID = message.GetField(sid).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.ExchangeGateway eg = new Fields.ExchangeGateway();
                if (message.IsSetField(eg))
                {
                    gateway = message.GetField(eg).getValue();
                }
                else
                { OK2Update = false; }

                QuickFix.Fields.LastShares q = new QuickFix.Fields.LastShares();
                if (message.IsSetField(q))
                {
                    tradesize = (int)message.GetField(q).getValue();
                }

                QuickFix.Fields.Side bs = new QuickFix.Fields.Side();
                if (message.IsSetField(bs))
                {
                    side = message.GetField(bs).getValue();
                }
                else
                {
                    if (tradesize < 0)
                    {
                        tradesize = Math.Abs(tradesize);
                        side = QuickFix.Fields.Side.SELL;
                    }
                    else
                    { side = QuickFix.Fields.Side.BUY; }
                }

                QuickFix.Fields.LastPx fill = new QuickFix.Fields.LastPx();
                if (message.IsSetField(fill))
                {
                    price = message.GetField(fill).getValue();
                }

                if (OK2Update)
//.........这里部分代码省略.........
开发者ID:AntoniosHadji,项目名称:TT-FIX-AutoFlatten,代码行数:101,代码来源:QFApplication.cs

示例2: ProcessMessage

        /// <summary>
        /// Simply parse out message data on the mainForm ListBox control and into a LOG file
        /// </summary>
        /// <param name="message"></param>
        /// <param name="sessionID"></param>
        public void ProcessMessage(QuickFix.Message message, QuickFix.SessionID sessionID)
        {
            try
            {
                updateDisplay(string.Format("{0} {1}", DateTime.Now.ToString("hh:mm:ss.fff"), message.GetType().FullName));

                foreach (int i in message.FieldOrder)
                {
                    updateDisplay(string.Format("TAG: {0} = {1}", i, message.GetField(i) ));
                }

                if (message.IsSetField(QuickFix.Fields.Tags.NoGateways))
                { updateDisplay("NoGateways"); }

                if (message.IsSetField(QuickFix.Fields.Tags.NoGatewayStatus))
                { updateDisplay("NoGatewayStatus"); }

                if (message.IsSetField(QuickFix.Fields.Tags.NoMDEntries))
                { updateDisplay("NoMDEntries"); }

                if (message.IsSetField(QuickFix.Fields.Tags.NoMDEntryTypes))
                { updateDisplay("NoMDEntryTypes"); }

            }
            catch (Exception ex)
            {
                updateDisplay("QuickFIX Error");
                log.WriteLog(ex.ToString());
            }
        }
开发者ID:AntoniosHadji,项目名称:TT-FIX-AutoFlatten,代码行数:35,代码来源:QFApplication.cs

示例3: OnMessage

        //Receive market data
        public void OnMessage(QuickFix.FIX42.MarketDataSnapshotFullRefresh message, SessionID session)
        {
            decimal _bidPrice = 0.00M;
            decimal _askPrice = 0.00M;

            try
            {
                QuickFix.Group noMDEntriesGrp = new QuickFix.FIX42.MarketDataSnapshotFullRefresh.NoMDEntriesGroup();

                for (int grpIndex = 1; grpIndex <= message.GetInt(QuickFix.Fields.Tags.NoMDEntries); grpIndex += 1)
                {
                    noMDEntriesGrp = message.GetGroup(grpIndex, QuickFix.Fields.Tags.NoMDEntries);

                    if (noMDEntriesGrp.IsSetField(QuickFix.Fields.Tags.BidPx))
                    {
                        _bidPrice = QuickFix.Fields.Converters.DecimalConverter.Convert(noMDEntriesGrp.GetField(QuickFix.Fields.Tags.BidPx));
                    }

                    if (noMDEntriesGrp.IsSetField(QuickFix.Fields.Tags.OfferPx))
                    {
                        _askPrice = QuickFix.Fields.Converters.DecimalConverter.Convert(noMDEntriesGrp.GetField(QuickFix.Fields.Tags.OfferPx));
                    }

                }

                string SecEx = null;
                string symbol = null;
                string secID = null;

                QuickFix.Fields.SecurityExchange se = new QuickFix.Fields.SecurityExchange();
                if (message.IsSetField(se))
                { SecEx = message.GetField(se).ToString(); }

                QuickFix.Fields.Symbol s = new QuickFix.Fields.Symbol();
                if (message.IsSetField(s))
                { symbol = message.GetField(s).ToString(); }

                QuickFix.Fields.SecurityID sid = new QuickFix.Fields.SecurityID();
                if (message.IsSetField(sid))
                { secID = message.GetField(sid).ToString(); }

                updatePrices(SecEx, symbol, secID, _bidPrice, _askPrice);
            }
            catch (Exception ex)
            {
                updateDisplay(string.Format("QuickFIX Error: {0}", System.Reflection.MethodBase.GetCurrentMethod().Name));
                log.WriteLog(string.Format("{0} : {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString()));
            }
        }
开发者ID:AntoniosHadji,项目名称:TT-FIX-AutoFlatten,代码行数:50,代码来源:QFApplication.cs


注:本文中的QuickFix.GetField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。