TradingSessionSubID Field
상속: StringField
예제 #1
0
 public void Set(QuickFix.Fields.TradingSessionSubID val) 
 { 
     this.TradingSessionSubID = val;
 }
예제 #2
0
 public bool IsSet(QuickFix.Fields.TradingSessionSubID val)
 {
     return(IsSetTradingSessionSubID());
 }
예제 #3
0
 public void Set(QuickFix.Fields.TradingSessionSubID val)
 {
     this.TradingSessionSubID = val;
 }
예제 #4
0
 public QuickFix.Fields.TradingSessionSubID Get(QuickFix.Fields.TradingSessionSubID val)
 {
     GetField(val);
     return(val);
 }
예제 #5
0
        /// <summary>
        /// Creates a FIX4.4 NewOrderSingle message for Fxcm
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public QuickFix.FIX44.NewOrderSingle NewOrderSingle(Order order)
        {
            var newOrderSingle = new QuickFix.FIX44.NewOrderSingle();

            var clOrdId = new QuickFix.Fields.ClOrdID(order.OrderID);

            newOrderSingle.SetField(clOrdId);

            var account = new QuickFix.Fields.Account(_account);

            newOrderSingle.SetField(account);

            //var noTradingSession = new QuickFix.Fields.NoTradingSessions(1);
            //newOrderSingle.SetField(noTradingSession);

            // Create a new Trading Session Group
            QuickFix.FIX44.NewOrderSingle.NoTradingSessionsGroup noTradingSession = new QuickFix.FIX44.NewOrderSingle.NoTradingSessionsGroup();
            {
                var tradingSessionId = new QuickFix.Fields.TradingSessionID(_tradeTargetCompId);
                noTradingSession.SetField(tradingSessionId);

                var tradingSessionSubId = new QuickFix.Fields.TradingSessionSubID(_tradeTargetSubId);
                noTradingSession.SetField(tradingSessionSubId);

                newOrderSingle.AddGroup(noTradingSession);
            }

            var securityType = new QuickFix.Fields.SecurityType(FixCommon.Constants.SecurityType.ForeignExchangeContract);

            newOrderSingle.SetField(securityType);

            var symbol = new QuickFix.Fields.Symbol(order.Security.Symbol);

            newOrderSingle.SetField(symbol);

            var product = new QuickFix.Fields.Product(FixCommon.Constants.Product.Currency);

            newOrderSingle.SetField(product);

            //set order side
            if (order.OrderSide == Constants.OrderSide.BUY)
            {
                newOrderSingle.Set(new Side(Side.BUY));
            }
            else if (order.OrderSide == Constants.OrderSide.SELL)
            {
                newOrderSingle.Set(new Side(Side.SELL));
            }

            var transactTime = new QuickFix.Fields.TransactTime(order.OrderDateTime);

            newOrderSingle.SetField(transactTime);

            var orderQty = new QuickFix.Fields.OrderQty(order.OrderSize);

            newOrderSingle.SetField(orderQty);

            //var minQty = new QuickFix.Fields.MinQty(order.OrderSize);
            //newOrderSingle.SetField(minQty);

            //only limit and market orders are supported.
            if (order.GetType() == typeof(LimitOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.LIMIT));
                newOrderSingle.Set(new Price(((LimitOrder)order).LimitPrice));

                var tif = new QuickFix.Fields.TimeInForce(FixCommon.Converter.ConvertTif.GetFixValue(order.OrderTif));
                newOrderSingle.SetField(tif);
            }
            else if (order.GetType() == typeof(MarketOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.MARKET));
            }

            //var maxShow = new QuickFix.Fields.MaxShow(order.OrderSize);
            //newOrderSingle.SetField(maxShow);

            //var execInst = new QuickFix.Fields.ExecInst(ExecInst.BEST_EXECUTION);
            //newOrderSingle.SetField(execInst);

            var currency = new QuickFix.Fields.Currency(order.OrderCurrency);

            newOrderSingle.SetField(currency);

            //var handlInst = new QuickFix.Fields.HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE);
            //newOrderSingle.SetField(handlInst);

            return(newOrderSingle);
        }