コード例 #1
0
        public QuickFix.FIX42.MarketDataRequest QueryMarketDataRequest42(string productName)
        {
            MDReqID mdReqID = new MDReqID("MARKETDATAID");
            SubscriptionRequestType subType     = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES);
            MarketDepth             marketDepth = new MarketDepth(1);

            QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup marketDataEntryGroup = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
            marketDataEntryGroup.Set(new MDEntryType(MDEntryType.BID));

            QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
            symbolGroup.Set(new Symbol(productName));
            symbolGroup.Set(new SecurityExchange("*"));
            symbolGroup.Set(new SecurityType(SecurityType.COMMON_STOCK));

            QuickFix.FIX42.MarketDataRequest message = new QuickFix.FIX42.MarketDataRequest(mdReqID, subType, marketDepth);
            message.AddGroup(marketDataEntryGroup);
            message.AddGroup(symbolGroup);

            return(message);
        }
コード例 #2
0
        public Task SendMarketDataRequest(string symbol, string exchange, Action <string> progressHandler)
        {
            return(Task.Run(() =>
            {
                //Create object of Security Definition
                QuickFix.FIX42.MarketDataRequest securityDefinition = new QuickFix.FIX42.MarketDataRequest
                {
                    MDReqID = new MDReqID(Guid.NewGuid().ToString()),
                    SubscriptionRequestType = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES),
                    MarketDepth = new MarketDepth(1),
                    MDUpdateType = new MDUpdateType(0)
                };

                var noMDEntryTypes = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
                var mdEntryType_bid = new MDEntryType(MDEntryType.BID);
                noMDEntryTypes.Set(mdEntryType_bid);
                securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.OFFER)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.TRADE)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.OPENING_PRICE)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.SETTLEMENT_PRICE)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.TRADING_SESSION_HIGH_PRICE)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.TRADING_SESSION_LOW_PRICE)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.TRADE_VOLUME)); securityDefinition.AddGroup(noMDEntryTypes);
                noMDEntryTypes.Set(new MDEntryType(MDEntryType.OPEN_INTEREST)); securityDefinition.AddGroup(noMDEntryTypes);

                securityDefinition.NoRelatedSym = new NoRelatedSym(1);

                var relatedSymbol = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
                relatedSymbol.Set(new Symbol(symbol));
                relatedSymbol.Set(new SecurityExchange(exchange));
                securityDefinition.AddGroup(relatedSymbol);
                Session.SendToTarget(securityDefinition, _currentSessionId);
                progressHandler("Sent MarketData Request");
            }));
        }
コード例 #3
0
        private QuickFix.FIX42.MarketDataRequest QueryMarketDataRequest42()
        {
            MDReqID mdReqID = new MDReqID("MARKETDATAID");
            SubscriptionRequestType subType     = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT);
            MarketDepth             marketDepth = new MarketDepth(0);

            QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup marketDataEntryGroup = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
            marketDataEntryGroup.Set(new MDEntryType(MDEntryType.BID));

            QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
            symbolGroup.Set(new Symbol("LNUX"));

            QuickFix.FIX42.MarketDataRequest message = new QuickFix.FIX42.MarketDataRequest(mdReqID, subType, marketDepth);
            message.AddGroup(marketDataEntryGroup);
            message.AddGroup(symbolGroup);

            QueryHeader(message.Header);

            Console.WriteLine(message.ToString());
            return(message);
        }
コード例 #4
0
        /// <summary>
        /// Request Bid and offer prices subscription for a specific contract.
        /// </summary>
        /// <param name="SecEx">Exchange</param>
        /// <param name="symbol">Exchange symbol for contract</param>
        /// <param name="secID">unique identifier supplied by the exchnage for this contract 
        /// For eurex this is the ticker and expiration</param>
        public void ttMarketDataRequest(string SecEx, string symbol, string secID)
        {
            try
            {
                QuickFix.FIX42.MarketDataRequest mdr = new QuickFix.FIX42.MarketDataRequest();

                mdr.Set(new QuickFix.Fields.MDReqID(string.Concat(SecEx, ":", symbol, ":", secID)));
                mdr.Set(new QuickFix.Fields.SubscriptionRequestType(QuickFix.Fields.SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES));
                mdr.Set(new QuickFix.Fields.MDUpdateType(QuickFix.Fields.MDUpdateType.FULL_REFRESH)); //required if above type is SNAPSHOT_PLUS_UPDATES
                mdr.Set(new QuickFix.Fields.MarketDepth(1));
                mdr.Set(new QuickFix.Fields.AggregatedBook(true));

                QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup tgroup = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
                tgroup.Set(new QuickFix.Fields.MDEntryType(QuickFix.Fields.MDEntryType.BID));
                mdr.AddGroup(tgroup);
                tgroup.Set(new QuickFix.Fields.MDEntryType(QuickFix.Fields.MDEntryType.OFFER));
                mdr.AddGroup(tgroup);
                //tgroup.Set(new QuickFix.Fields.MDEntryType(QuickFix.Fields.MDEntryType.TRADE));
                //mdr.addGroup(tgroup);

                QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup sgroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();

                sgroup.Set(new QuickFix.Fields.SecurityExchange(SecEx));
                sgroup.Set(new QuickFix.Fields.Symbol(symbol));
                sgroup.Set(new QuickFix.Fields.SecurityID(secID));
                mdr.AddGroup(sgroup);

                QuickFix.Session.SendToTarget(mdr, priceSessionID);
            }
            catch (Exception ex)
            { log.WriteLog(ex.ToString()); }
        }
コード例 #5
0
        private QuickFix.FIX42.MarketDataRequest QueryMarketDataRequest42()
        {
            MDReqID mdReqID = new MDReqID( "MARKETDATAID" );
            SubscriptionRequestType subType = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT);
            MarketDepth marketDepth = new MarketDepth(0);

            QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup marketDataEntryGroup = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
            marketDataEntryGroup.Set( new MDEntryType(MDEntryType.BID) );

            QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
            symbolGroup.Set(new Symbol("LNUX"));

            QuickFix.FIX42.MarketDataRequest message = new QuickFix.FIX42.MarketDataRequest( mdReqID, subType, marketDepth );
            message.AddGroup( marketDataEntryGroup );
            message.AddGroup( symbolGroup );

            QueryHeader( message.Header );

            Console.WriteLine(message.ToString());
            return message;
        }
コード例 #6
0
ファイル: Client.cs プロジェクト: huruixd/quickfixn
        public QuickFix.FIX42.MarketDataRequest QueryMarketDataRequest42(string productName)
        {
            MDReqID mdReqID = new MDReqID("MARKETDATAID");
            SubscriptionRequestType subType = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES);
            MarketDepth marketDepth = new MarketDepth(1);

            QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup marketDataEntryGroup = new QuickFix.FIX42.MarketDataRequest.NoMDEntryTypesGroup();
            marketDataEntryGroup.Set(new MDEntryType(MDEntryType.BID));

            QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
            symbolGroup.Set(new Symbol(productName));
            symbolGroup.Set(new SecurityExchange("*"));
            symbolGroup.Set(new SecurityType(SecurityType.COMMON_STOCK));

            QuickFix.FIX42.MarketDataRequest message = new QuickFix.FIX42.MarketDataRequest(mdReqID, subType, marketDepth);
            message.AddGroup(marketDataEntryGroup);
            message.AddGroup(symbolGroup);

            return message;
        }