예제 #1
0
 protected override void PrepareXmlMessage(string name)
 {
     base.PrepareXmlMessage("OrdCxlReq");
     xml.SetAttribute("ID", OrderCancelId);
     if (ClientOrderId != null)
     {
         xml.SetAttribute("OrigID", ClientOrderId);
     }
     if (BrokerOrderId != null)
     {
         xml.SetAttribute("OrdID", BrokerOrderId);
     }
     if (BrokerOrderId2 != null)
     {
         xml.SetAttribute("OrdID2", BrokerOrderId2);
     }
     if (Account != null)
     {
         xml.SetAttribute("Acct", Account);
     }
     if (Instrument != null)
     {
         Instrument.Write(xmlDoc, xml, "Instrmt");
     }
     if (Side != null)
     {
         xml.SetAttribute("Side", OrderSideUtil.Write(Side));
     }
     if (CreateTime != null)
     {
         xml.SetAttribute("TxnTm", FixmlUtil.WriteDateTime((DateTime)CreateTime));
     }
     if (Quantity != null)
     {
         AddElement(xml, "OrdQty").SetAttribute("Qty", Quantity.ToString());
     }
     if (Text != null)
     {
         xml.SetAttribute("Txt", Text);
     }
 }
 protected override void PrepareXmlMessage(string name)
 {
     base.PrepareXmlMessage("Order");
     xml.SetAttribute("ID", ClientOrderId);
     if (TradeDate != null)
     {
         xml.SetAttribute("TrdDt", FixmlUtil.WriteDate((DateTime)TradeDate));
     }
     if (Account != null)
     {
         xml.SetAttribute("Acct", Account);
     }
     if (MinimumQuantity != null)
     {
         xml.SetAttribute("MinQty", FixmlUtil.WriteDecimal(MinimumQuantity));
     }
     if (DisplayQuantity != null)
     {
         AddElement(xml, "DsplyInstr").SetAttribute("DisplayQty", FixmlUtil.WriteDecimal(DisplayQuantity));
     }
     if (Instrument != null)
     {
         Instrument.Write(xmlDoc, xml, "Instrmt");
     }
     if (Side != null)
     {
         xml.SetAttribute("Side", OrderSideUtil.Write(Side));
     }
     xml.SetAttribute("TxnTm", FixmlUtil.WriteDateTime(CreateTime));
     AddElement(xml, "OrdQty").SetAttribute("Qty", Quantity.ToString());
     xml.SetAttribute("OrdTyp", OrderTypeUtil.Write(Type));
     if (Price != null)
     {
         xml.SetAttribute("Px", FixmlUtil.WriteDecimal(Price));
     }
     if (StopPrice != null)
     {
         xml.SetAttribute("StopPx", FixmlUtil.WriteDecimal(StopPrice));
     }
     if (Currency != null)
     {
         xml.SetAttribute("Ccy", Currency);
     }
     xml.SetAttribute("TmInForce", OrdTmInForceUtil.Write(TimeInForce));
     if (ExpireDate != null)
     {
         xml.SetAttribute("ExpireDt", FixmlUtil.WriteDate((DateTime)ExpireDate));
     }
     if (TriggerPrice != null)
     {
         XmlElement el = AddElement("TrgrInstr");
         el.SetAttribute("TrgrTyp", TriggerType.ToString());
         el.SetAttribute("TrgrActn", TriggerAction.ToString());
         el.SetAttribute("TrgrPx", FixmlUtil.WriteDecimal(TriggerPrice));
         el.SetAttribute("TrgrPxTyp", TriggerPriceType.ToString());
     }
     if (DeferredPaymentType != null)
     {
         xml.SetAttribute("DefPayTyp", DeferredPaymentType.ToString());
     }
 }