pub struct StopOrderRequest {Show 13 fields
pub instrument: InstrumentName,
pub units: DecimalNumber,
pub price: PriceValue,
pub price_bound: Option<PriceValue>,
pub time_in_force: Option<StopOrderTimeInForce>,
pub gtd_time: Option<DateTime>,
pub position_fill: Option<OrderPositionFill>,
pub trigger_condition: Option<OrderTriggerCondition>,
pub client_extensions: Option<ClientExtensions>,
pub take_profit_on_fill: Option<TakeProfitDetails>,
pub stop_loss_on_fill: Option<StopLossDetails>,
pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
pub trade_client_extensions: Option<ClientExtensions>,
}Expand description
Specification of a stop order. Required fields are set by
StopOrderRequest::new; everything else is optional.
Fields§
§instrument: InstrumentNameThe stop order’s instrument.
units: DecimalNumberThe quantity requested to be filled. A positive number creates a long order, a negative number a short order.
price: PriceValueThe price threshold: the order will only be filled at this price or worse.
price_bound: Option<PriceValue>The worst market price that may be used to fill the order (only
with TimeInForce FOK or IOC).
time_in_force: Option<StopOrderTimeInForce>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.
position_fill: Option<OrderPositionFill>How positions in the account are modified when the order fills
(default DEFAULT).
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.
take_profit_on_fill: Option<TakeProfitDetails>A take-profit order to create for a trade opened when the order fills.
stop_loss_on_fill: Option<StopLossDetails>A stop-loss order to create for a trade opened when the order fills.
trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>A trailing stop-loss order to create for a trade opened when the order fills.
trade_client_extensions: Option<ClientExtensions>The client extensions to add to a trade opened when the order fills.
Implementations§
Source§impl StopOrderRequest
impl StopOrderRequest
Sourcepub fn new(
instrument: impl Into<InstrumentName>,
units: impl Into<DecimalNumber>,
price: impl Into<PriceValue>,
) -> Self
pub fn new( instrument: impl Into<InstrumentName>, units: impl Into<DecimalNumber>, price: impl Into<PriceValue>, ) -> Self
A stop order for units of instrument triggered at price.
Sourcepub fn price_bound(self, value: impl Into<PriceValue>) -> Self
pub fn price_bound(self, value: impl Into<PriceValue>) -> Self
Sets the worst acceptable fill price (with FOK/IOC).
Sourcepub fn time_in_force(self, value: impl Into<StopOrderTimeInForce>) -> Self
pub fn time_in_force(self, value: impl Into<StopOrderTimeInForce>) -> 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 position_fill(self, value: impl Into<OrderPositionFill>) -> Self
pub fn position_fill(self, value: impl Into<OrderPositionFill>) -> Self
Sets how positions are modified on fill (default DEFAULT).
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.
Sourcepub fn take_profit_on_fill(self, value: impl Into<TakeProfitDetails>) -> Self
pub fn take_profit_on_fill(self, value: impl Into<TakeProfitDetails>) -> Self
Attaches a take-profit to the trade opened on fill.
Sourcepub fn stop_loss_on_fill(self, value: impl Into<StopLossDetails>) -> Self
pub fn stop_loss_on_fill(self, value: impl Into<StopLossDetails>) -> Self
Attaches a stop-loss to the trade opened on fill.
Sourcepub fn trailing_stop_loss_on_fill(
self,
value: impl Into<TrailingStopLossDetails>,
) -> Self
pub fn trailing_stop_loss_on_fill( self, value: impl Into<TrailingStopLossDetails>, ) -> Self
Attaches a trailing stop-loss to the trade opened on fill.
Sourcepub fn trade_client_extensions(self, value: impl Into<ClientExtensions>) -> Self
pub fn trade_client_extensions(self, value: impl Into<ClientExtensions>) -> Self
Attaches client extensions to the trade opened on fill.
Trait Implementations§
Source§impl Clone for StopOrderRequest
impl Clone for StopOrderRequest
Source§fn clone(&self) -> StopOrderRequest
fn clone(&self) -> StopOrderRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more