pub struct GuaranteedStopLossOrderRequest {
pub type: Option<OrderType>,
pub trade_id: TradeID,
pub client_trade_id: Option<ClientID>,
pub price: Decimal,
pub distance: Option<Decimal>,
pub time_in_force: TimeInForce,
pub gtd_time: Option<Timestamp>,
pub trigger_condition: OrderTriggerCondition,
pub client_extensions: Option<ClientExtensions>,
}Expand description
A GuaranteedStopLossOrderRequest specifies the parameters that may be set when creating a Guaranteed
Stop Loss Order. Only one of the price and distance fields may be specified.
The published definition requires price while allowing distance only in
its absence. This DTO follows that requiredness: outbound admission rejects
an explicit distance alongside the required price. Distance-only creation is
unavailable under this published contract; received fields remain inspectable.
Fields§
§type: Option<OrderType>The type of the Order to Create. Must be set to “GUARANTEED_STOP_LOSS” when creating a Guaranteed Stop
Loss Order.
trade_id: TradeIDThe ID of the Trade to close when the price threshold is breached.
client_trade_id: Option<ClientID>The client ID of the Trade to be closed when the price threshold is breached.
price: DecimalThe price threshold specified for the Guaranteed Stop Loss Order. The associated Trade will be closed at this price.
distance: Option<Decimal>Specifies the distance (in price units) from the Account’s current price to use as the Guaranteed Stop Loss Order price. If the Trade is short the Instrument’s bid price is used, and for long Trades the ask is used.
time_in_force: TimeInForceThe time-in-force requested for the GuaranteedStopLoss Order. Restricted to “GTC”, “GFD” and “GTD” for
GuaranteedStopLoss Orders.
gtd_time: Option<Timestamp>The date/time when the GuaranteedStopLoss Order will be cancelled if its timeInForce is “GTD”.
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.
client_extensions: Option<ClientExtensions>The client extensions to add to the Order. Do not set, modify, or delete clientExtensions if your account is associated with MT4.