pub struct SetTradingStopRequest {Show 16 fields
pub category: Category,
pub symbol: String,
pub position_idx: PositionIdx,
pub take_profit: Option<Decimal>,
pub stop_loss: Option<Decimal>,
pub trailing_stop: Option<Decimal>,
pub tp_trigger_by: Option<TriggerBy>,
pub sl_trigger_by: Option<TriggerBy>,
pub active_price: Option<Decimal>,
pub tp_size: Option<Decimal>,
pub sl_size: Option<Decimal>,
pub tp_limit_price: Option<Decimal>,
pub sl_limit_price: Option<Decimal>,
pub tp_order_type: Option<OrderType>,
pub sl_order_type: Option<OrderType>,
pub tpsl_mode: Option<TpslMode>,
}Fields§
§category: Categorylinear, inverse
symbol: String§position_idx: PositionIdxRequired. 0: one-way, 1: hedge Buy side, 2: hedge Sell side
take_profit: Option<Decimal>§stop_loss: Option<Decimal>§trailing_stop: Option<Decimal>Trailing stop distance from market price
tp_trigger_by: Option<TriggerBy>§sl_trigger_by: Option<TriggerBy>§active_price: Option<Decimal>Activation price for trailing stop
tp_size: Option<Decimal>Partial TP quantity
sl_size: Option<Decimal>Partial SL quantity
tp_limit_price: Option<Decimal>Limit price for TP limit order
sl_limit_price: Option<Decimal>Limit price for SL limit order
tp_order_type: Option<OrderType>§sl_order_type: Option<OrderType>§tpsl_mode: Option<TpslMode>Implementations§
Source§impl SetTradingStopRequest
impl SetTradingStopRequest
pub fn new( category: Category, symbol: String, position_idx: PositionIdx, ) -> Self
pub fn with_take_profit(self, v: Decimal) -> Self
pub fn with_stop_loss(self, v: Decimal) -> Self
pub fn with_trailing_stop(self, v: Decimal) -> Self
pub fn with_tp_trigger_by(self, v: TriggerBy) -> Self
pub fn with_sl_trigger_by(self, v: TriggerBy) -> Self
pub fn with_active_price(self, v: Decimal) -> Self
pub fn with_tp_size(self, v: Decimal) -> Self
pub fn with_sl_size(self, v: Decimal) -> Self
pub fn with_tp_limit_price(self, v: Decimal) -> Self
pub fn with_sl_limit_price(self, v: Decimal) -> Self
pub fn with_tp_order_type(self, v: OrderType) -> Self
pub fn with_sl_order_type(self, v: OrderType) -> Self
pub fn with_tpsl_mode(self, v: TpslMode) -> Self
Trait Implementations§
Source§impl Debug for SetTradingStopRequest
impl Debug for SetTradingStopRequest
Auto Trait Implementations§
impl Freeze for SetTradingStopRequest
impl RefUnwindSafe for SetTradingStopRequest
impl Send for SetTradingStopRequest
impl Sync for SetTradingStopRequest
impl Unpin for SetTradingStopRequest
impl UnsafeUnpin for SetTradingStopRequest
impl UnwindSafe for SetTradingStopRequest
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