pub struct TakeProfitOrderRequest {
pub trade_id: TradeId,
pub client_trade_id: Option<ClientId>,
pub price: PriceValue,
pub time_in_force: Option<TakeProfitOrderTimeInForce>,
pub gtd_time: Option<DateTime>,
pub trigger_condition: Option<OrderTriggerCondition>,
pub client_extensions: Option<ClientExtensions>,
}Expand description
Specification of a take-profit 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.
price: PriceValueThe price threshold: the associated trade will be closed at this price or better.
time_in_force: Option<TakeProfitOrderTimeInForce>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 TakeProfitOrderRequest
impl TakeProfitOrderRequest
Sourcepub fn new(trade_id: impl Into<TradeId>, price: impl Into<PriceValue>) -> Self
pub fn new(trade_id: impl Into<TradeId>, price: impl Into<PriceValue>) -> Self
A take-profit order closing trade_id at price or better.
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<TakeProfitOrderTimeInForce>) -> Self
pub fn time_in_force(self, value: impl Into<TakeProfitOrderTimeInForce>) -> 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 TakeProfitOrderRequest
impl Clone for TakeProfitOrderRequest
Source§fn clone(&self) -> TakeProfitOrderRequest
fn clone(&self) -> TakeProfitOrderRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more