pub struct MarketOrder {Show 27 fields
pub id: Option<OrderID>,
pub create_time: Option<Timestamp>,
pub state: Option<OrderState>,
pub client_extensions: Option<ClientExtensions>,
pub type: Option<OrderType>,
pub instrument: InstrumentName,
pub units: Decimal,
pub time_in_force: TimeInForce,
pub price_bound: Option<Decimal>,
pub position_fill: OrderPositionFill,
pub trade_close: Option<MarketOrderTradeClose>,
pub long_position_closeout: Option<MarketOrderPositionCloseout>,
pub short_position_closeout: Option<MarketOrderPositionCloseout>,
pub margin_closeout: Option<MarketOrderMarginCloseout>,
pub delayed_trade_close: Option<MarketOrderDelayedTradeClose>,
pub take_profit_on_fill: Option<TakeProfitDetails>,
pub stop_loss_on_fill: Option<StopLossDetails>,
pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
pub trade_client_extensions: Option<ClientExtensions>,
pub filling_transaction_id: Option<TransactionID>,
pub filled_time: Option<Timestamp>,
pub trade_opened_id: Option<TradeID>,
pub trade_reduced_id: Option<TradeID>,
pub trade_closed_ids: Option<Vec<TradeID>>,
pub cancelling_transaction_id: Option<TransactionID>,
pub cancelled_time: Option<Timestamp>,
}Expand description
A MarketOrder is an order that is filled immediately upon creation using the current market price.
Fields§
§id: Option<OrderID>The Order’s identifier, unique within the Order’s Account.
create_time: Option<Timestamp>The time when the Order was created.
state: Option<OrderState>The current state of the Order.
client_extensions: Option<ClientExtensions>The client extensions of the Order. Do not set, modify, or delete clientExtensions if your account is associated with MT4.
type: Option<OrderType>The type of the Order. Always set to “MARKET” for Market Orders.
instrument: InstrumentNameThe Market Order’s Instrument.
units: DecimalThe quantity requested to be filled by the Market Order. A positive number of units results in a long Order, and a negative number of units results in a short Order.
time_in_force: TimeInForceThe time-in-force requested for the Market Order. Restricted to FOK or IOC for a MarketOrder.
price_bound: Option<Decimal>The worst price that the client is willing to have the Market Order filled at.
position_fill: OrderPositionFillSpecification of how Positions in the Account are modified when the Order is filled.
trade_close: Option<MarketOrderTradeClose>Details of the Trade requested to be closed, only provided when the Market Order is being used to explicitly close a Trade.
long_position_closeout: Option<MarketOrderPositionCloseout>Details of the long Position requested to be closed out, only provided when a Market Order is being used to explicitly closeout a long Position.
short_position_closeout: Option<MarketOrderPositionCloseout>Details of the short Position requested to be closed out, only provided when a Market Order is being used to explicitly closeout a short Position.
margin_closeout: Option<MarketOrderMarginCloseout>Details of the Margin Closeout that this Market Order was created for
delayed_trade_close: Option<MarketOrderDelayedTradeClose>Details of the delayed Trade close that this Market Order was created for
take_profit_on_fill: Option<TakeProfitDetails>TakeProfitDetails specifies the details of a Take Profit Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly through the Trade.
stop_loss_on_fill: Option<StopLossDetails>StopLossDetails specifies the details of a Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through the Trade.
guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed Stop Loss Order is modified directly through the Trade.
trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop Loss Order is modified directly through the Trade.
trade_client_extensions: Option<ClientExtensions>Client Extensions to add to the Trade created when the Order is filled (if such a Trade is created). Do not set, modify, or delete tradeClientExtensions if your account is associated with MT4.
filling_transaction_id: Option<TransactionID>ID of the Transaction that filled this Order (only provided when the Order’s state is FILLED)
filled_time: Option<Timestamp>Date/time when the Order was filled (only provided when the Order’s state is FILLED)
trade_opened_id: Option<TradeID>Trade ID of Trade opened when the Order was filled (only provided when the Order’s state is FILLED and a Trade was opened as a result of the fill)
trade_reduced_id: Option<TradeID>Trade ID of Trade reduced when the Order was filled (only provided when the Order’s state is FILLED and a Trade was reduced as a result of the fill)
trade_closed_ids: Option<Vec<TradeID>>Trade IDs of Trades closed when the Order was filled (only provided when the Order’s state is FILLED and one or more Trades were closed as a result of the fill)
cancelling_transaction_id: Option<TransactionID>ID of the Transaction that cancelled the Order (only provided when the Order’s state is CANCELLED)
cancelled_time: Option<Timestamp>Date/time when the Order was cancelled (only provided when the state of the Order is CANCELLED)