pub struct BybitTpSlParams {Show 18 fields
pub take_profit: Option<Price>,
pub stop_loss: Option<Price>,
pub tp_trigger_by: Option<BybitTriggerType>,
pub sl_trigger_by: Option<BybitTriggerType>,
pub tp_order_type: Option<BybitOrderType>,
pub sl_order_type: Option<BybitOrderType>,
pub tp_limit_price: Option<String>,
pub sl_limit_price: Option<String>,
pub tp_trigger_price: Option<String>,
pub sl_trigger_price: Option<String>,
pub tpsl_mode: Option<BybitTpSlMode>,
pub close_on_trigger: Option<bool>,
pub is_leverage: bool,
pub order_iv: Option<String>,
pub mmp: Option<bool>,
pub position_idx: Option<BybitPositionIdx>,
pub bbo_side_type: Option<BybitBboSideType>,
pub bbo_level: Option<String>,
}Expand description
Parsed and validated Bybit TP/SL parameters from a SubmitOrder.params map.
Fields§
§take_profit: Option<Price>§stop_loss: Option<Price>§tp_trigger_by: Option<BybitTriggerType>§sl_trigger_by: Option<BybitTriggerType>§tp_order_type: Option<BybitOrderType>§sl_order_type: Option<BybitOrderType>§tp_limit_price: Option<String>§sl_limit_price: Option<String>§tp_trigger_price: Option<String>§sl_trigger_price: Option<String>§tpsl_mode: Option<BybitTpSlMode>§close_on_trigger: Option<bool>§is_leverage: bool§order_iv: Option<String>§mmp: Option<bool>§position_idx: Option<BybitPositionIdx>§bbo_side_type: Option<BybitBboSideType>§bbo_level: Option<String>Implementations§
Source§impl BybitTpSlParams
impl BybitTpSlParams
pub fn has_tp_sl(&self) -> bool
pub fn has_bbo(&self) -> bool
Sourcepub fn to_native_tp_sl(&self) -> BybitNativeTpSlParams
pub fn to_native_tp_sl(&self) -> BybitNativeTpSlParams
Projects the native TP/SL and option fields onto the bundle the HTTP submit_order entry
expects. BBO, position_idx, and leverage stay separate because they are already
first-class arguments on the submit_order signature.
Trait Implementations§
Source§impl Debug for BybitTpSlParams
impl Debug for BybitTpSlParams
Source§impl Default for BybitTpSlParams
impl Default for BybitTpSlParams
Source§fn default() -> BybitTpSlParams
fn default() -> BybitTpSlParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BybitTpSlParams
impl RefUnwindSafe for BybitTpSlParams
impl Send for BybitTpSlParams
impl Sync for BybitTpSlParams
impl Unpin for BybitTpSlParams
impl UnsafeUnpin for BybitTpSlParams
impl UnwindSafe for BybitTpSlParams
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more