OrderQty Field
Inheritance: DecimalField
Beispiel #1
0
 public ExecutionReport(
     QuickFix.Fields.OrderID aOrderID,
     QuickFix.Fields.ExecID aExecID,
     QuickFix.Fields.ExecTransType aExecTransType,
     QuickFix.Fields.OrdStatus aOrdStatus,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty,
     QuickFix.Fields.LastShares aLastShares,
     QuickFix.Fields.LastPx aLastPx,
     QuickFix.Fields.CumQty aCumQty,
     QuickFix.Fields.AvgPx aAvgPx
     ) : this()
 {
     this.OrderID       = aOrderID;
     this.ExecID        = aExecID;
     this.ExecTransType = aExecTransType;
     this.OrdStatus     = aOrdStatus;
     this.Symbol        = aSymbol;
     this.Side          = aSide;
     this.OrderQty      = aOrderQty;
     this.LastShares    = aLastShares;
     this.LastPx        = aLastPx;
     this.CumQty        = aCumQty;
     this.AvgPx         = aAvgPx;
 }
        /// <summary>
        /// Creates a FIX4.3 NewOrderSingle message for GTX
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public QuickFix.FIX43.NewOrderSingle NewOrderSingle(Order order)
        {
            var newOrderSingle = new QuickFix.FIX43.NewOrderSingle();

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

            newOrderSingle.SetField(clOrdId);

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

            newOrderSingle.SetField(symbol);

            var side = new QuickFix.Fields.Side(Convert.ToChar(order.OrderSide));

            newOrderSingle.SetField(side);

            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));
            }
            else if (order.GetType() == typeof(MarketOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.MARKET));
            }

            var tif = new QuickFix.Fields.TimeInForce(FixCommon.Converter.ConvertTif.GetFixValue(order.OrderTif));

            newOrderSingle.SetField(tif);

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

            newOrderSingle.SetField(execInst);

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

            newOrderSingle.SetField(currency);

            return(newOrderSingle);
        }
Beispiel #3
0
 public OrderCancelRequest(
     QuickFix.Fields.OrigClOrdID aOrigClOrdID,
     QuickFix.Fields.ClOrdID aClOrdID,
     QuickFix.Fields.CxlType aCxlType,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty
     ) : this()
 {
     this.OrigClOrdID = aOrigClOrdID;
     this.ClOrdID     = aClOrdID;
     this.CxlType     = aCxlType;
     this.Symbol      = aSymbol;
     this.Side        = aSide;
     this.OrderQty    = aOrderQty;
 }
Beispiel #4
0
 public DontKnowTrade(
     QuickFix.Fields.DKReason aDKReason,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty,
     QuickFix.Fields.LastShares aLastShares,
     QuickFix.Fields.LastPx aLastPx
     ) : this()
 {
     this.DKReason   = aDKReason;
     this.Symbol     = aSymbol;
     this.Side       = aSide;
     this.OrderQty   = aOrderQty;
     this.LastShares = aLastShares;
     this.LastPx     = aLastPx;
 }
Beispiel #5
0
 public NewOrderSingle(
     QuickFix.Fields.ClOrdID aClOrdID,
     QuickFix.Fields.HandlInst aHandlInst,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty,
     QuickFix.Fields.OrdType aOrdType
     ) : this()
 {
     this.ClOrdID   = aClOrdID;
     this.HandlInst = aHandlInst;
     this.Symbol    = aSymbol;
     this.Side      = aSide;
     this.OrderQty  = aOrderQty;
     this.OrdType   = aOrdType;
 }
 public OrderCancelReplaceRequest(
     QuickFix.Fields.OrigClOrdID aOrigClOrdID,
     QuickFix.Fields.ClOrdID aClOrdID,
     QuickFix.Fields.HandlInst aHandlInst,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty,
     QuickFix.Fields.OrdType aOrdType
     ) : this()
 {
     this.OrigClOrdID = aOrigClOrdID;
     this.ClOrdID     = aClOrdID;
     this.HandlInst   = aHandlInst;
     this.Symbol      = aSymbol;
     this.Side        = aSide;
     this.OrderQty    = aOrderQty;
     this.OrdType     = aOrdType;
 }
Beispiel #7
0
 public NewOrderList(
     QuickFix.Fields.ListID aListID,
     QuickFix.Fields.ListSeqNo aListSeqNo,
     QuickFix.Fields.ListNoOrds aListNoOrds,
     QuickFix.Fields.ClOrdID aClOrdID,
     QuickFix.Fields.HandlInst aHandlInst,
     QuickFix.Fields.Symbol aSymbol,
     QuickFix.Fields.Side aSide,
     QuickFix.Fields.OrderQty aOrderQty,
     QuickFix.Fields.OrdType aOrdType
     ) : this()
 {
     this.ListID     = aListID;
     this.ListSeqNo  = aListSeqNo;
     this.ListNoOrds = aListNoOrds;
     this.ClOrdID    = aClOrdID;
     this.HandlInst  = aHandlInst;
     this.Symbol     = aSymbol;
     this.Side       = aSide;
     this.OrderQty   = aOrderQty;
     this.OrdType    = aOrdType;
 }
        private static OrderData TranslateOrderImpl(Symbol symbol,
                                                    Side side,
                                                    OrdType ordType,
                                                    OrderQty orderQty,
                                                    Price price,
                                                    ClOrdID clOrdID,
                                                    Account account)
        {
            switch (ordType.getValue())
            {
                case OrdType.LIMIT:
                    if (price.Obj == 0)
                        throw new IncorrectTagValue(price.Tag);

                    break;

                    //case OrdType.MARKET: break;

                default:
                    throw new IncorrectTagValue(ordType.Tag);
            }

            return new OrderData
                {
                    MarketSide = TranslateFixFields.Translate(side),
                    Symbol = symbol.getValue(),
                    OrderType = TranslateFixFields.Translate(ordType),
                    Quantity = orderQty.getValue(),
                    Price = price.getValue(),
                    ClOrdID = clOrdID.getValue(),
                    Account =
                        account == null
                            ? TradingAccount.None
                            : new TradingAccount(account.getValue())
                };
        }
 public void Set(QuickFix.Fields.OrderQty val) 
 { 
     this.OrderQty = val;
 }
 public bool IsSet(QuickFix.Fields.OrderQty val)
 {
     return(IsSetOrderQty());
 }
 public QuickFix.Fields.OrderQty Get(QuickFix.Fields.OrderQty val)
 {
     GetField(val);
     return(val);
 }
 public void Set(QuickFix.Fields.OrderQty val)
 {
     this.OrderQty = val;
 }
        /// <summary>
        /// Creates a FIX4.4 NewOrderSingle message for Forexware
        /// </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 handlInst = new QuickFix.Fields.HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE);

            newOrderSingle.SetField(handlInst);

            //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 symbol = new QuickFix.Fields.Symbol(order.Security.Symbol);

            newOrderSingle.SetField(symbol);

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

            newOrderSingle.SetField(transactTime);

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

            newOrderSingle.SetField(orderQty);

            //limit, market and stop orders are supported.
            if (order.GetType() == typeof(LimitOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.LIMIT));
                newOrderSingle.Set(new Price(((LimitOrder)order).LimitPrice));
            }
            else if (order.GetType() == typeof(MarketOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.MARKET));
            }
            else if (order.GetType() == typeof(StopOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.STOP));

                // set StopPX field
                // TODO: add StopPx field
            }

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

            newOrderSingle.SetField(account);

            if (order.GetType() == typeof(LimitOrder) || order.GetType() == typeof(StopOrder))
            {
                var tif = new QuickFix.Fields.TimeInForce(FixCommon.Converter.ConvertTif.GetFixValue(order.OrderTif));
                newOrderSingle.SetField(tif);
            }

            return(newOrderSingle);
        }
        /// <summary>
        /// Creates a FIX4.3 NewOrderSingle message for Integral
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public QuickFix.FIX43.NewOrderSingle NewOrderSingle(Order order)
        {
            var newOrderSingle = new QuickFix.FIX43.NewOrderSingle();

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

            newOrderSingle.SetField(clOrdId);

            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));
            }
            else if (order.GetType() == typeof(MarketOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.MARKET));
            }

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

            newOrderSingle.SetField(maxShow);

            var tif = new QuickFix.Fields.TimeInForce(FixCommon.Converter.ConvertTif.GetFixValue(order.OrderTif));

            newOrderSingle.SetField(tif);

            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);
        }
Beispiel #15
0
        /// <summary>
        /// Creates a FIX4.2 NewOrderSingle message for Redi
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public QuickFix.FIX42.NewOrderSingle NewOrderSingle(Order order)
        {
            var newOrderSingle = new QuickFix.FIX42.NewOrderSingle();

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

            newOrderSingle.SetField(clOrdId);

            if (!string.IsNullOrEmpty(_account))
            {
                var account = new QuickFix.Fields.Account(_account);
                newOrderSingle.SetField(account);
            }

            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);

            //only limit and market orders are supported.
            if (order.GetType() == typeof(LimitOrder))
            {
                var execInst = new QuickFix.Fields.ExecInst("h");
                newOrderSingle.SetField(execInst);

                newOrderSingle.Set(new OrdType(OrdType.LIMIT));
                newOrderSingle.Set(new Price(((LimitOrder)order).LimitPrice));
            }
            else if (order.GetType() == typeof(MarketOrder))
            {
                newOrderSingle.Set(new OrdType(OrdType.MARKET));
            }

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

            newOrderSingle.SetField(orderQty);

            var exDestination = new QuickFix.Fields.ExDestination(";");

            newOrderSingle.SetField(exDestination);

            var country = new QuickFix.Fields.DeliverToLocationID("1");

            newOrderSingle.SetField(country);

            var side = new QuickFix.Fields.Side(Convert.ToChar(order.OrderSide));

            newOrderSingle.SetField(side);

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

            newOrderSingle.SetField(symbol);

            var tif = new QuickFix.Fields.TimeInForce(FixCommon.Converter.ConvertTif.GetFixValue(order.OrderTif));

            newOrderSingle.SetField(tif);

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

            newOrderSingle.SetField(transactTime);

            return(newOrderSingle);
        }