pub struct Trade {Show 20 fields
pub id: Option<TradeID>,
pub instrument: Option<InstrumentName>,
pub price: Option<Decimal>,
pub open_time: Option<Timestamp>,
pub state: Option<TradeState>,
pub initial_units: Option<Decimal>,
pub initial_margin_required: Option<Decimal>,
pub current_units: Option<Decimal>,
pub realized_pl: Option<Decimal>,
pub unrealized_pl: Option<Decimal>,
pub margin_used: Option<Decimal>,
pub average_close_price: Option<Decimal>,
pub closing_transaction_ids: Option<Vec<TransactionID>>,
pub financing: Option<Decimal>,
pub dividend_adjustment: Option<Decimal>,
pub close_time: Option<Timestamp>,
pub client_extensions: Option<ClientExtensions>,
pub take_profit_order: Option<TakeProfitOrder>,
pub stop_loss_order: Option<StopLossOrder>,
pub trailing_stop_loss_order: Option<TrailingStopLossOrder>,
}Expand description
The specification of a Trade within an Account. This includes the full representation of the Trade’s dependent Orders in addition to the IDs of those Orders.
Fields§
§id: Option<TradeID>The Trade’s identifier, unique within the Trade’s Account.
instrument: Option<InstrumentName>The Trade’s Instrument.
price: Option<Decimal>The execution price of the Trade.
open_time: Option<Timestamp>The date/time when the Trade was opened.
state: Option<TradeState>The current state of the Trade.
initial_units: Option<Decimal>The initial size of the Trade. Negative values indicate a short Trade, and positive values indicate a long Trade.
initial_margin_required: Option<Decimal>The margin required at the time the Trade was created. Note, this is the ‘pure’ margin required, it is not the ‘effective’ margin used that factors in the trade risk if a GSLO is attached to the trade.
current_units: Option<Decimal>The number of units currently open for the Trade. This value is reduced to 0.0 as the Trade is closed.
realized_pl: Option<Decimal>The total profit/loss realized on the closed portion of the Trade.
unrealized_pl: Option<Decimal>The unrealized profit/loss on the open portion of the Trade.
margin_used: Option<Decimal>Margin currently used by the Trade.
average_close_price: Option<Decimal>The average closing price of the Trade. Only present if the Trade has been closed or reduced at least once.
closing_transaction_ids: Option<Vec<TransactionID>>The IDs of the Transactions that have closed portions of this Trade.
financing: Option<Decimal>The financing paid/collected for this Trade.
dividend_adjustment: Option<Decimal>The dividend adjustment paid for this Trade.
close_time: Option<Timestamp>The date/time when the Trade was fully closed. Only provided for Trades whose state is CLOSED.
client_extensions: Option<ClientExtensions>The client extensions of the Trade.
take_profit_order: Option<TakeProfitOrder>Full representation of the Trade’s Take Profit Order, only provided if such an Order exists.
stop_loss_order: Option<StopLossOrder>Full representation of the Trade’s Stop Loss Order, only provided if such an Order exists.
trailing_stop_loss_order: Option<TrailingStopLossOrder>Full representation of the Trade’s Trailing Stop Loss Order, only provided if such an Order exists.