當前位置: 首頁>>代碼示例>>C#>>正文


C# QuickFix.SessionID類代碼示例

本文整理匯總了C#中QuickFix.SessionID的典型用法代碼示例。如果您正苦於以下問題:C# SessionID類的具體用法?C# SessionID怎麽用?C# SessionID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SessionID類屬於QuickFix命名空間,在下文中一共展示了SessionID類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: onLogon

		public virtual void onLogon(SessionID sessionID)
		{
			Console.WriteLine("SessionID: " + sessionID);
			if (this.IxROVD6JN == null)
				return;
			this.IxROVD6JN((object)this, new FIXSessionIDEventArgs(sessionID));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:7,代碼來源:QuickFIX43Application.cs

示例3: NewOrderSingle

        internal static dynamic NewOrderSingle(SessionID sid)
        {
            if (sid == null)
            {
                return null;
            }

            string value = sid.getBeginString();

            if (value.Equals("FIX.4.0"))
                return new QuickFix40.NewOrderSingle();

            if (value.Equals("FIX.4.1"))
                return new QuickFix41.NewOrderSingle();

            if (value.Equals("FIX.4.2"))
                return new QuickFix42.NewOrderSingle();

            if (value.Equals("FIX.4.3"))
                return new QuickFix43.NewOrderSingle();

            if (value.Equals("FIX.4.4"))
                return new QuickFix44.NewOrderSingle();

            if (value.Equals("FIX.5.0"))
                return new QuickFix50.NewOrderSingle();

            return null;
        }
開發者ID:6xiao,項目名稱:CSharpQuantTools,代碼行數:29,代碼來源:MessageFactory.cs

示例4: OrderCancelRequest

        internal static dynamic OrderCancelRequest(SessionID sid)
        {
            if (sid == null)
            {
                return null;
            }

            string value = sid.getBeginString();

            if (value.Equals("FIX.4.0"))
                return new QuickFix40.OrderCancelRequest();

            if (value.Equals("FIX.4.1"))
                return new QuickFix41.OrderCancelRequest();

            if (value.Equals("FIX.4.2"))
                return new QuickFix42.OrderCancelRequest();

            if (value.Equals("FIX.4.3"))
                return new QuickFix43.OrderCancelRequest();

            if (value.Equals("FIX.4.4"))
                return new QuickFix44.OrderCancelRequest();

            if (value.Equals("FIX.5.0"))
                return new QuickFix50.OrderCancelRequest();

            return null;
        }
開發者ID:6xiao,項目名稱:CSharpQuantTools,代碼行數:29,代碼來源:MessageFactory.cs

示例5: fromApp

        public void fromApp(QuickFix.Message message, SessionID sessionID)
        {
            // receiving messages
            Symbol sym = new Symbol();
            message.getField(sym);
            Tick k = new TickImpl(sym.getValue());
			
			{
            // bid
            BidPx bp = new BidPx();
            BidSize bs = new BidSize();
            k.bid = (decimal)bp.getValue();
            k.bs = (int)message.getField(bs).getValue();
			}
			
			{
            // ask
            OfferPx op = new OfferPx();
            OfferSize os = new OfferSize();
            k.ask = (decimal)op.getValue();
            k.os = (int)message.getField(os).getValue();
			}
			
			{
            // last
            Price price = new Price();
            message.getField(price);
            k.trade = (decimal)price.getValue();
			}
			
            tl.newTick(k);
            //ClOrdID clOrdID = new ClOrdID();
            //message.getField(clOrdID);
        }
開發者ID:bluejack2000,項目名稱:core,代碼行數:34,代碼來源:ServerQuickFix.cs

示例6: onLogout

		public virtual void onLogout(SessionID sessionID)
		{
			Console.WriteLine("SessionID: " + sessionID);
			if (this.N4PQenDmP == null)
				return;
			this.N4PQenDmP(this, new FIXSessionIDEventArgs(sessionID));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:7,代碼來源:QuickFIX42Application.cs

示例7: OnLogon

        public void OnLogon( SessionID sessionID)
        {
            Session session = Session.LookupSession(sessionID);
            Message message =  null;

            //行情訂閱
            message = OKMarketDataRequest.create24HTickerRequest();

            //深度訂閱
            //message = OKMarketDataRequest.createOrderBookRequest();

            //用戶信息請求
            //message = OKTradingRequest.createUserAccountRequest();

            //創建訂單
            // try{
            //     message = OKTradingRequest.createOrderBookRequest();
            // } catch (Exception e) {
            //     Console.WriteLine(e.Message);
            // }

             //取消訂單請求
             // message = OKTradingRequest.createOrderCancelRequest();

             //訂單狀態請求
             // message = OKTradingRequest.createOrderStatusRequest();
            session.Send(message);
        }
開發者ID:OKCoin,項目名稱:fix,代碼行數:28,代碼來源:QuickeFixApp.cs

示例8: onLogon

		public virtual void onLogon(SessionID sessionID)
		{
			Console.WriteLine("SessionID: " + sessionID);
			if (this.lCISky2Q1 == null)
				return;
			this.lCISky2Q1(this, new FIXSessionIDEventArgs(sessionID));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:7,代碼來源:QuickFIX42Application.cs

示例9: SendNewOrderSingle

        public void SendNewOrderSingle(string symbol, int quantity, decimal? price, decimal? stop, decimal? gain, string account, SessionID session)
        {
            clOrdId = DateTime.Now.Ticks.ToString();
            lastSymbol = symbol;
            lastAccount = account;

            var newOrderSingle = new NewOrderSingle(new ClOrdID(clOrdId),
                                                    new Symbol(symbol),
                                                    new Side(Side.BUY),
                                                    new TransactTime(DateTime.Now),
                                                    new OrdType(gain.HasValue ? 'X' : stop.HasValue ? OrdType.STOP : price.HasValue ? OrdType.LIMIT : OrdType.MARKET))
                {
                    Account = new Account(account),
                    OrderQty = new OrderQty(quantity),
                    TargetStrategy = new TargetStrategy(TargetStrategy),
                    TimeInForce = new TimeInForce(TIF),
                };

            if (TIF == TimeInForce.GOOD_TILL_DATE)
                newOrderSingle.ExpireDate = new ExpireDate(DateTime.Today.AddDays(1).AsLocalMktDate());

            if (stop.HasValue)
                newOrderSingle.StopPx = new StopPx(stop.Value);

            if (price.HasValue)
                newOrderSingle.Price = new Price(price.Value);

            if (gain.HasValue)
                newOrderSingle.SetField(new DecimalField(6001, gain.Value));

            Session.SendToTarget(newOrderSingle, session);
        }
開發者ID:renatofj,項目名稱:TradingTools,代碼行數:32,代碼來源:SwingTradeDriver.cs

示例10: onLogout

		public virtual void onLogout(SessionID sessionID)
		{
			Console.WriteLine("SessionID: " + sessionID);
			if (this.Br2Z76TG6 == null)
				return;
			this.Br2Z76TG6((object)this, new FIXSessionIDEventArgs(sessionID));
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:7,代碼來源:QuickFIX43Application.cs

示例11: onLogout

		public override void onLogout(SessionID sessionID)
		{
			bool flag1;
			if (this.priceSessionID == null)
			{
				flag1 = true;
			}
			else
			{
				Session session = Session.lookupSession(this.priceSessionID);
				flag1 = session != null && !session.isLoggedOn();
			}
			bool flag2;
			if (this.orderSessionID == null)
			{
				flag2 = true;
			}
			else
			{
				Session session = Session.lookupSession(this.orderSessionID);
				flag2 = session != null && !session.isLoggedOn();
			}
			if (!flag1 || !flag2)
				return;
			this.EmitLogout((SessionID)null);
		}
開發者ID:heber,項目名稱:FreeOQ,代碼行數:26,代碼來源:QuickFIX43CommonApplication.cs

示例12: FileStore

        public FileStore(string path, SessionID sessionID)
        {
            //BEGIN - Custom part

            //search for special directory (ie: %appdata%)
            if (path.StartsWith("%"))
            {
                int end = path.IndexOf("%", 1);
                string specialFolderName = path.Substring(1, end - 1);

                Environment.SpecialFolder specialFolder = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), specialFolderName, true);
                string specialPath = Environment.GetFolderPath(specialFolder);

                path = Path.Combine(specialPath, path.Substring(end + 2));
            }

            //END - Custom part

            if (!System.IO.Directory.Exists(path))
                System.IO.Directory.CreateDirectory(path);

            string prefix = Prefix(sessionID);

            seqNumsFileName_ = System.IO.Path.Combine(path, prefix + ".seqnums");
            msgFileName_ = System.IO.Path.Combine(path, prefix + ".body");
            headerFileName_ = System.IO.Path.Combine(path, prefix + ".header");
            sessionFileName_ = System.IO.Path.Combine(path, prefix + ".session");

            open();
        }
開發者ID:blackhill,項目名稱:quickfixn,代碼行數:30,代碼來源:FileStore.cs

示例13: OnCreate

        public void OnCreate(SessionID sessionID)
        {
            Session session = Session.LookupSession(sessionID);

            // Hey QF/J users, don't do this in a real app.
            if (null != session)
                session.Reset("AT Session Reset");
        }
開發者ID:Paccc,項目名稱:quickfixn,代碼行數:8,代碼來源:ATApplication.cs

示例14: onLogon

        public void onLogon(SessionID sessionID)
        {
            Console.WriteLine("onLogon " + sessionID);

            String exchange = "CME";
            String symbol = "CL";
            RequestSymbols(exchange, symbol, sessionID);
        }
開發者ID:benofben,項目名稱:implier,代碼行數:8,代碼來源:FIXApplication.cs

示例15: ToAdmin

 public void ToAdmin(Message message, SessionID sessionID)
 {
     if (message.Header.GetField(Tags.MsgType) == MsgType.LOGON)
     {
         message.SetField(new QuickFix.Fields.Username("batman"));
         message.SetField(new QuickFix.Fields.Password("gotham123"));
     }
 }
開發者ID:gbirchmeier,項目名稱:QfnDemoApps,代碼行數:8,代碼來源:PilotInit44App.cs


注:本文中的QuickFix.SessionID類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。