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


C# QuickFix.GetGroup方法代码示例

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


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

示例1: OnMessage

 private void OnMessage(QuickFix.FIX42.MarketDataRequest m, SessionID s)
 {
     QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
     m.GetGroup(1, symbolGroup);
     string symbolName = symbolGroup.Get(new Symbol()).getValue();
     string mdRequestId = m.MDReqID.ToString();
     if (!m_ProductSubscription.ContainsKey(symbolName)) {
         bool fullSpeed = symbolName.StartsWith("B");
         Console.WriteLine("Subscribe : " + symbolName + ". Full Speed: " + fullSpeed);
         QuotePublisher publisher = new QuotePublisher(symbolName, mdRequestId, fullSpeed, s);
         m_ProductSubscription.Add(symbolName, publisher);
     }
 }
开发者ID:huruixd,项目名称:quickfixn,代码行数:13,代码来源:Server.cs

示例2: OnMessage

        //receive responses from position request messages
        //public void onPositionReportMessage(QuickFix.FIX42.Message message, SessionID session)
        //{
        //    TT.PosReqId req = new TT.PosReqId();
        //    string r = message.GetField(req).getValue(); //SOD, DSOD, MANUAL_FILL, TRADES
        //    log.WriteLog(r);
        //    TT.TotalNumPosReports num = new TT.TotalNumPosReports();
        //    int numReports = message.GetField(num).getValue() ;
        //    log.WriteLog(numReports.ToString());
        //    TT.PosMaintRptId uniqueID = new TT.PosMaintRptId();
        //    if (posReports.Contains(message.GetField(uniqueID).getValue()))
        //    { updateDisplay("Duplicate position report recieved and discarded: " + uniqueID.ToString()); }
        //    else
        //    {
        //        posReports.Add(message.GetField(uniqueID).getValue());
        //        if (message.IsSetField(num) && numReports != 0)
        //        {
        //            updateDisplay(string.Format("{0} updates in this {1} report",num, r));
        //            posTableUpdate(message, session);
        //        }
        //        else
        //        { updateDisplay(string.Format("No Updates in this {0} position report", r)); }
        //        switch (r)
        //        {
        //            case "SOD":
        //                ctrSOD += 1;
        //                if (numReports == 0 || ctrSOD == numReports) { SODLoaded = true; }
        //                break;
        //            case "DSOD":
        //                ctrSOD += 1;
        //                if (numReports == 0 || ctrSOD == numReports) { SODLoaded = true; }
        //                break;
        //            case "MANUAL_FILL":
        //                ctrMAN += 1;
        //                if (numReports == 0 || ctrMAN == numReports) { ManualFillsLoaded = true; }
        //                break;
        //            case "TRADES":
        //                ctrTRD += 1;
        //                if (numReports == 0 || ctrTRD == numReports) { previousTradesLoaded = true; }
        //                break;
        //            default:
        //                break;
        //        }
        //        log.WriteLog("SOD Loaded: " + SODLoaded.ToString());
        //        log.WriteLog("MAN Loaded: " + ManualFillsLoaded.ToString());
        //        log.WriteLog("TRD Loaded: " + previousTradesLoaded.ToString());
        //        if (SODLoaded && ManualFillsLoaded && previousTradesLoaded && !PositionLoadedReported)
        //        {
        //            updateOnOff();
        //            updateDisplay("RISK MANUAL FILLS AND TRADES LOADED");
        //            PositionLoadedReported = true;
        //        }
        //    }
        //}
        public void OnMessage(QuickFix.FIX42.GatewayStatus message, SessionID session)
        {
            QuickFix.Group g = new QuickFix.FIX42.GatewayStatus.NoGatewayStatusGroup();
            for (int i = 1; i <= message.GroupCount(message.NoGatewayStatus.getValue()); i++)
            {
                message.GetGroup(i, g);
                string exch = g.GetField(new QuickFix.Fields.ExchangeGateway()).getValue();
                int server = g.GetField(new QuickFix.Fields.SubExchangeGateway()).getValue();
                int status = g.GetField(new QuickFix.Fields.GatewayStatus()).getValue();
                string text = null;

                try
                {
                    text = g.GetField(new QuickFix.Fields.Text()).ToString();
                    updateDisplay(string.Format("Text: {0}", text));
                }
                catch (Exception ex)
                { updateDisplay(string.Format("NO TEXT:{0}", ex.ToString())); }

                updateGateway(exch,
                    new QuickFix.Fields.SubExchangeGateway(server).toStringField().ToString(),
                    new QuickFix.Fields.GatewayStatus(status).toStringField().ToString(),
                    text);
            }
        }
开发者ID:AntoniosHadji,项目名称:TT-FIX-AutoFlatten,代码行数:79,代码来源:QFApplication.cs


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