pub struct TrailingStopLossOrderRequest {
pub trade_id: TradeId,
pub client_trade_id: Option<ClientId>,
pub distance: DecimalNumber,
pub time_in_force: Option<TrailingStopLossOrderTimeInForce>,
pub gtd_time: Option<DateTime>,
pub trigger_condition: Option<OrderTriggerCondition>,
pub client_extensions: Option<ClientExtensions>,
}Expand description
Specification of a trailing stop-loss order attached to an existing trade.
Fields§
§trade_id: TradeIdThe ID of the trade to close when the order is filled.
client_trade_id: Option<ClientId>The client ID of the trade to be closed when the order is filled.
distance: DecimalNumberThe distance (in price units) from the trade’s fill price that the trailing stop-loss trails.
time_in_force: Option<TrailingStopLossOrderTimeInForce>The time-in-force for the order (default GTC).
gtd_time: Option<DateTime>The date/time when the order is cancelled if time_in_force is
GTD.
trigger_condition: Option<OrderTriggerCondition>Which price component is used to trigger the order (default
DEFAULT).
client_extensions: Option<ClientExtensions>The client extensions to add to the order.
Implementations§
Source§impl TrailingStopLossOrderRequest
impl TrailingStopLossOrderRequest
Sourcepub fn new(
trade_id: impl Into<TradeId>,
distance: impl Into<DecimalNumber>,
) -> Self
pub fn new( trade_id: impl Into<TradeId>, distance: impl Into<DecimalNumber>, ) -> Self
A trailing stop-loss order for trade_id trailing at distance
price units.
Sourcepub fn client_trade_id(self, value: impl Into<ClientId>) -> Self
pub fn client_trade_id(self, value: impl Into<ClientId>) -> Self
Targets the trade by its client-provided ID instead.
Sourcepub fn time_in_force(
self,
value: impl Into<TrailingStopLossOrderTimeInForce>,
) -> Self
pub fn time_in_force( self, value: impl Into<TrailingStopLossOrderTimeInForce>, ) -> Self
Sets the time-in-force (default GTC).
Sourcepub fn gtd_time(self, value: impl Into<DateTime>) -> Self
pub fn gtd_time(self, value: impl Into<DateTime>) -> Self
Sets the cancellation time used with GTD.
Sourcepub fn trigger_condition(self, value: impl Into<OrderTriggerCondition>) -> Self
pub fn trigger_condition(self, value: impl Into<OrderTriggerCondition>) -> Self
Sets the price component used for triggering.
Sourcepub fn client_extensions(self, value: impl Into<ClientExtensions>) -> Self
pub fn client_extensions(self, value: impl Into<ClientExtensions>) -> Self
Attaches client extensions to the order.
Trait Implementations§
Source§impl Clone for TrailingStopLossOrderRequest
impl Clone for TrailingStopLossOrderRequest
Source§fn clone(&self) -> TrailingStopLossOrderRequest
fn clone(&self) -> TrailingStopLossOrderRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more