pub struct SetTradingStopParams {Show 16 fields
pub category: Category,
pub symbol: String,
pub position_idx: PositionIdx,
pub take_profit: Option<String>,
pub stop_loss: Option<String>,
pub trailing_stop: Option<String>,
pub tp_trigger_by: Option<TriggerBy>,
pub sl_trigger_by: Option<TriggerBy>,
pub active_price: Option<String>,
pub tpsl_mode: Option<String>,
pub tp_size: Option<String>,
pub sl_size: Option<String>,
pub tp_limit_price: Option<String>,
pub sl_limit_price: Option<String>,
pub tp_order_type: Option<OrderType>,
pub sl_order_type: Option<OrderType>,
}Expand description
Parameters for setting trading stop (TP/SL/trailing stop).
Fields§
§category: CategoryProduct category.
symbol: StringTrading symbol.
position_idx: PositionIdxPosition index.
take_profit: Option<String>Take profit price.
stop_loss: Option<String>Stop loss price.
trailing_stop: Option<String>Trailing stop distance.
tp_trigger_by: Option<TriggerBy>Take profit trigger type.
sl_trigger_by: Option<TriggerBy>Stop loss trigger type.
active_price: Option<String>Active price for trailing stop.
tpsl_mode: Option<String>TP/SL mode (Full or Partial).
tp_size: Option<String>TP size for partial mode.
sl_size: Option<String>SL size for partial mode.
tp_limit_price: Option<String>TP limit price.
sl_limit_price: Option<String>SL limit price.
tp_order_type: Option<OrderType>TP order type.
sl_order_type: Option<OrderType>SL order type.
Implementations§
Source§impl SetTradingStopParams
impl SetTradingStopParams
Sourcepub fn new(
category: Category,
symbol: impl Into<String>,
position_idx: PositionIdx,
) -> Self
pub fn new( category: Category, symbol: impl Into<String>, position_idx: PositionIdx, ) -> Self
Create new parameters.
Sourcepub fn take_profit(self, tp: impl Into<String>) -> Self
pub fn take_profit(self, tp: impl Into<String>) -> Self
Set take profit price.
Sourcepub fn trailing_stop(self, ts: impl Into<String>) -> Self
pub fn trailing_stop(self, ts: impl Into<String>) -> Self
Set trailing stop distance.
Sourcepub fn tp_trigger_by(self, by: TriggerBy) -> Self
pub fn tp_trigger_by(self, by: TriggerBy) -> Self
Set take profit trigger type.
Sourcepub fn sl_trigger_by(self, by: TriggerBy) -> Self
pub fn sl_trigger_by(self, by: TriggerBy) -> Self
Set stop loss trigger type.
Trait Implementations§
Source§impl Clone for SetTradingStopParams
impl Clone for SetTradingStopParams
Source§fn clone(&self) -> SetTradingStopParams
fn clone(&self) -> SetTradingStopParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SetTradingStopParams
impl Debug for SetTradingStopParams
Auto Trait Implementations§
impl Freeze for SetTradingStopParams
impl RefUnwindSafe for SetTradingStopParams
impl Send for SetTradingStopParams
impl Sync for SetTradingStopParams
impl Unpin for SetTradingStopParams
impl UnwindSafe for SetTradingStopParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more