pub struct StopOrder {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 price: Decimal,
pub price_bound: Option<Decimal>,
pub time_in_force: TimeInForce,
pub gtd_time: Option<Timestamp>,
pub position_fill: OrderPositionFill,
pub trigger_condition: OrderTriggerCondition,
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>,
pub replaces_order_id: Option<OrderID>,
pub replaced_by_order_id: Option<OrderID>,
}Expand description
A StopOrder is an order that is created with a price threshold, and will only be filled by a price that is equal to or worse than the threshold.
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 “STOP” for Stop Orders.
instrument: InstrumentNameThe Stop Order’s Instrument.
units: DecimalThe quantity requested to be filled by the Stop Order. A positive number of units results in a long Order, and a negative number of units results in a short Order.
price: DecimalThe price threshold specified for the Stop Order. The Stop Order will only be filled by a market price that is equal to or worse than this price.
price_bound: Option<Decimal>The worst market price that may be used to fill this Stop Order. If the market gaps and crosses through both the price and the priceBound, the Stop Order will be cancelled instead of being filled.
time_in_force: TimeInForceThe time-in-force requested for the Stop Order.
gtd_time: Option<Timestamp>The date/time when the Stop Order will be cancelled if its timeInForce is “GTD”.
position_fill: OrderPositionFillSpecification of how Positions in the Account are modified when the Order is filled.
trigger_condition: OrderTriggerConditionSpecification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA’s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order’s trigger condition is set to the default value when indicating the distance from an Order’s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a Guaranteed Stop Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for short trades “DEFAULT” and “ASK” are valid.
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)
replaces_order_id: Option<OrderID>The ID of the Order that was replaced by this Order (only provided if this Order was created as part of a cancel/replace).
replaced_by_order_id: Option<OrderID>The ID of the Order that replaced this Order (only provided if this Order was cancelled as part of a cancel/replace).