Пример #1
0
        /// <summary>
        /// Creates an XML Element representing a placment in the execution document.
        /// </summary>
        /// <param name="xmlDocument">The destination XML document.</param>
        /// <param name="execution">A execution record.</param>
        public LocalExecutionElement(XmlDocument xmlDocument, ExecutionSet.ExecutionRow executionRow) :
            base("LocalExecution", xmlDocument)
        {
            // Broker field
            if (!executionRow.IsBrokerIdNull())
            {
                AddAttribute("BrokerId", executionRow.BrokerId.ToString());

                ClientMarketData.BrokerRow brokerRow = ClientMarketData.Broker.FindByBrokerId(executionRow.BrokerId);
                if (brokerRow != null)
                {
                    AddAttribute("BrokerId", brokerRow.BrokerId.ToString());
                    AddAttribute("BrokerName", brokerRow.ObjectRow.Name);
                    AddAttribute("BrokerSymbol", brokerRow.Symbol);
                    if (!brokerRow.IsPhoneNull())
                    {
                        AddAttribute("BrokerPhone", brokerRow.Phone);
                    }
                }
            }

            // Add the attributes of a execution to this record.
            AddAttribute("ExecutionId", executionRow.ExecutionId.ToString());
            AddAttribute("Quantity", executionRow.Quantity.ToString());
            AddAttribute("Price", executionRow.Price.ToString());
            AddAttribute("Commission", executionRow.Commission.ToString());
            AddAttribute("AccruedInterest", executionRow.AccruedInterest.ToString());
            AddAttribute("UserFee0", executionRow.UserFee0.ToString());
            AddAttribute("UserFee1", executionRow.UserFee1.ToString());
            AddAttribute("UserFee2", executionRow.UserFee2.ToString());
            AddAttribute("UserFee3", executionRow.UserFee3.ToString());
            AddAttribute("TradeDate", executionRow.TradeDate.ToString("s"));
            AddAttribute("SettlementDate", executionRow.SettlementDate.ToString("s"));
        }
Пример #2
0
        public LocalExecution(ExecutionSet.ExecutionRow executionRow)
        {
            this.isLocal = true;

            // Initialize the members.
            this.rowVersion   = executionRow.RowVersion;
            this.blockOrderId = executionRow.BlockOrderId;
            if (!executionRow.IsBrokerIdNull())
            {
                this.brokerId = executionRow.BrokerId;

                ClientMarketData.BrokerRow brokerRow = ClientMarketData.Broker.FindByBrokerId(executionRow.BrokerId);
                if (brokerRow != null)
                {
                    this.brokerSymbol = brokerRow.Symbol;
                    this.brokerName   = brokerRow.ObjectRow.Name;
                }
            }

            this.executionId     = executionRow.ExecutionId;
            this.quantity        = executionRow.Quantity;
            this.price           = executionRow.Price;
            this.commission      = executionRow.Commission;
            this.accruedInterest = executionRow.AccruedInterest;
            this.userFee0        = executionRow.UserFee0;
            this.userFee1        = executionRow.UserFee1;
            this.userFee2        = executionRow.UserFee2;
            this.userFee3        = executionRow.UserFee3;
            if (!executionRow.IsTradeDateNull())
            {
                this.tradeDate = executionRow.TradeDate;
            }
            if (!executionRow.IsSettlementDateNull())
            {
                this.settlementDate = executionRow.SettlementDate;
            }
        }
Пример #3
0
 /// <summary>
 /// Creates a execution element for the ExecutionDocument
 /// </summary>
 /// <param name="executionRow">A Execution record</param>
 /// <returns>An element that represents a execution.</returns>
 public LocalExecutionElement CreateLocalExecutionElement(ExecutionSet.ExecutionRow executionRow)
 {
     return(new LocalExecutionElement(this, executionRow));
 }