public static void PlaceNewSingleOrder() { QuickFix44.NewOrderSingle order = new QuickFix44.NewOrderSingle(); #region Order Details QuickFix.OrderQty orderQty = new QuickFix.OrderQty(10); order.setField(orderQty); QuickFix.Symbol symbol = new QuickFix.Symbol("EGS48031C016"); order.setField(symbol); QuickFix.SecurityID secID = new QuickFix.SecurityID("EGS48031C016"); order.setField(secID); QuickFix.Side side = new QuickFix.Side(Side.SELL); order.setField(side); QuickFix.OrdType ordType = new QuickFix.OrdType(OrdType.LIMIT); order.setField(ordType); QuickFix.Price price = new QuickFix.Price(10); order.setField(price); Currency currency = new Currency("EGP"); order.setField(currency); Account acc = new Account("1003"); order.setField(acc); QuickFix.PartyID custody = new PartyID("5004"); order.setField(custody); TimeInForce tif = new TimeInForce(TimeInForce.DAY); order.setField(tif); IDSource ids = new IDSource("4"); order.setField(ids); TransactTime tt = new TransactTime(DateTime.Now); order.setField(tt); //SenderSubID ss = new SenderSubID("05095a"); order.setField(ss); #endregion Order Details #region Fix Order Message IDs QuickFix.ClOrdID clOrdID = new ClOrdID(Guid.NewGuid().ToString()); order.setField(clOrdID); #endregion Fix Order Message IDs #region Exchange ExDestination exd = new ExDestination("CA"); order.setField(exd); TradingSessionID tradSession = new TradingSessionID("NOPL"); order.setField(tradSession); #endregion Exchange Session.sendToTarget(order, _app.SessionID); }
//[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.Synchronized)] public static void PlaceNewSingleOrder(string _clOrderID, string _clientID, string _securityCode, int _quantity, double _price, string _custodyCode, char _orderSide, char _orderType, string currencyCode, string exDestination, char _timeInForce, string groupID, char handleInst, DateTime expiration, bool hasAON, int minQty) { QuickFix44.NewOrderSingle order = new QuickFix44.NewOrderSingle(); #region Order Details QuickFix.OrderQty orderQty = new QuickFix.OrderQty(_quantity); order.setField(orderQty); QuickFix.Symbol symbol = new QuickFix.Symbol(_securityCode); order.setField(symbol); QuickFix.SecurityID secID = new QuickFix.SecurityID(_securityCode); order.setField(secID); QuickFix.Side side = new QuickFix.Side(_orderSide); order.setField(side); QuickFix.OrdType ordType = new QuickFix.OrdType(_orderType); order.setField(ordType); QuickFix.Price price = new QuickFix.Price(_price); order.setField(price); Currency currency = new Currency(currencyCode); order.setField(currency); Account acc = new Account(_clientID); order.setField(acc); //QuickFix.ClearingFirm custody = new ClearingFirm(_custodyCode);order.setField(custody); QuickFix.PartyID custody = new PartyID(_custodyCode); order.setField(custody); //QuickFix.PartyRole pr = new PartyRole(PartyRole.CUSTODIAN); order.setField(pr); //QuickFix.NoPartyIDs npid = new NoPartyIDs(1); order.setField(npid); //QuickFix.PartyIDSource pid = new PartyIDSource(PartyIDSource.PROPRIETARY); order.setField(pid); TimeInForce tif = new TimeInForce(_timeInForce); order.setField(tif); IDSource ids = new IDSource("4"); order.setField(ids); TransactTime tt = new TransactTime(DateTime.Now); order.setField(tt); //SenderSubID ss = new SenderSubID("05095a"); order.setField(ss); if (_timeInForce == QuickFix.TimeInForce.GOOD_TILL_DATE) { ExpireDate ed = new ExpireDate(expiration.ToString("yyyyMMdd")); order.setField(ed); //ExpireTime et = new ExpireTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour + 4, 0, 0)); order.setField(et); ExpireTime et = new ExpireTime(expiration); order.setField(et); } if (hasAON) { order.setField(new ExecInst(ExecInst.ALL_OR_NONE.ToString())); order.setField(new MinQty(minQty)); } #endregion Order Details #region Fix Order Message IDs QuickFix.ClOrdID clOrdID = new QuickFix.ClOrdID(string.Format("{0}{1}", _wcfMsgPrefix, _clOrderID)); order.setField(clOrdID); #endregion Fix Order Message IDs #region Reporting //QuickFix.HandlInst handlInst = new QuickFix.HandlInst(QuickFix.HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION); order.setField(handlInst); QuickFix.HandlInst handlInst = new QuickFix.HandlInst(handleInst); order.setField(handlInst); #endregion Reporting #region Exchange ExDestination exd = new ExDestination(exDestination); order.setField(exd); TradingSessionID tradSession = new TradingSessionID(groupID); order.setField(tradSession); #endregion Exchange Session.sendToTarget(order, _sessionID); }
/// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new System.Text.StringBuilder(); sb.Append("class OrderResponse {\n"); sb.Append(" OrderID: ").Append(OrderId.ToString()).Append("\n"); sb.Append(" ClOrdID: ").Append(ClOrdId.ToString()).Append("\n"); sb.Append(" ClOrdLinkID: ").Append(ClOrdLinkId.ToString()).Append("\n"); sb.Append(" Account: ").Append(Account.ToString()).Append("\n"); sb.Append(" Symbol: ").Append(Symbol.ToString()).Append("\n"); sb.Append(" Side: ").Append(Side.ToString()).Append("\n"); sb.Append(" OrderQty: ").Append(OrderQty.ToString()).Append("\n"); sb.Append(" Price: ").Append(Price.ToString()).Append("\n"); sb.Append(" DisplayQty: ").Append((DisplayQty == null) ? "null" : DisplayQty.ToString()).Append("\n"); sb.Append(" StopPx: ").Append((StopPx == null) ? "null" : StopPx.ToString()).Append("\n"); sb.Append(" PegOffsetValue: ").Append((PegOffsetValue == null) ? "null" : PegOffsetValue.ToString()).Append("\n"); sb.Append(" PegPriceType: ").Append((PegPriceType == null) ? "null" : PegPriceType.ToString()).Append("\n"); sb.Append(" Currency: ").Append((Currency == null) ? "null" : Currency.ToString()).Append("\n"); sb.Append(" SettlCurrency: ").Append((SettlCurrency == null) ? "null" : SettlCurrency.ToString()).Append("\n"); sb.Append(" OrdType: ").Append((OrdType == null) ? "null" : OrdType.ToString()).Append("\n"); sb.Append(" TimeInForce: ").Append((TimeInForce == null) ? "null" : TimeInForce.ToString()).Append("\n"); sb.Append(" ExecInst: ").Append((ExecInst == null) ? "null" : ExecInst.ToString()).Append("\n"); sb.Append(" ContingencyType: ").Append((ContingencyType == null) ? "null" : ContingencyType.ToString()).Append("\n"); sb.Append(" ExDestination: ").Append((ExDestination == null) ? "null" : ExDestination.ToString()).Append("\n"); sb.Append(" OrdStatus: ").Append((OrdStatus == null) ? "null" : OrdStatus.ToString()).Append("\n"); sb.Append(" Triggered: ").Append((Triggered == null) ? "null" : Triggered.ToString()).Append("\n"); sb.Append(" WorkingIndicator: ").Append((WorkingIndicator == null) ? "null" : WorkingIndicator.ToString()).Append("\n"); sb.Append(" OrdRejReason: ").Append((OrdRejReason == null) ? "null" : OrdRejReason.ToString()).Append("\n"); sb.Append(" LeavesQty: ").Append((LeavesQty == null) ? "null" : LeavesQty.ToString()).Append("\n"); sb.Append(" CumQty: ").Append((CumQty == null) ? "null" : CumQty.ToString()).Append("\n"); sb.Append(" AvgPx: ").Append((AvgPx == null) ? "null" : AvgPx.ToString()).Append("\n"); sb.Append(" MultiLegReportingType: ").Append((MultiLegReportingType == null) ? "null" : MultiLegReportingType.ToString()).Append("\n"); sb.Append(" Text: ").Append((Text == null) ? "null" : Text.ToString()).Append("\n"); sb.Append(" TransactTime: ").Append(TransactTime.ToString()).Append("\n"); sb.Append(" Timestamp: ").Append(Timestamp.ToString()).Append("\n"); sb.Append("}\n"); return(sb.ToString()); }