pub struct TriggerOrder { /* private fields */ }Expand description
Fluent trigger order builder (stop-loss / take-profit)
Implementations§
Source§impl TriggerOrder
impl TriggerOrder
Sourcepub fn take_profit(asset: impl Into<String>) -> Self
pub fn take_profit(asset: impl Into<String>) -> Self
Create a take-profit order
Sourcepub fn trigger_price(self, price: f64) -> Self
pub fn trigger_price(self, price: f64) -> Self
Set the trigger price
Sourcepub fn reduce_only(self) -> Self
pub fn reduce_only(self) -> Self
Set as reduce-only
Sourcepub fn not_reduce_only(self) -> Self
pub fn not_reduce_only(self) -> Self
Allow increasing position
Sourcepub fn get_trigger_price(&self) -> Option<Decimal>
pub fn get_trigger_price(&self) -> Option<Decimal>
Get the trigger price
Sourcepub fn get_limit_price(&self) -> Option<Decimal>
pub fn get_limit_price(&self) -> Option<Decimal>
Get the limit price
Sourcepub fn is_reduce_only(&self) -> bool
pub fn is_reduce_only(&self) -> bool
Is reduce-only?
Sourcepub fn to_request(
&self,
asset_index: usize,
execution_price: Decimal,
) -> OrderRequest
pub fn to_request( &self, asset_index: usize, execution_price: Decimal, ) -> OrderRequest
Convert to an OrderRequest
Trait Implementations§
Source§impl Clone for TriggerOrder
impl Clone for TriggerOrder
Source§fn clone(&self) -> TriggerOrder
fn clone(&self) -> TriggerOrder
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 moreAuto Trait Implementations§
impl Freeze for TriggerOrder
impl RefUnwindSafe for TriggerOrder
impl Send for TriggerOrder
impl Sync for TriggerOrder
impl Unpin for TriggerOrder
impl UnsafeUnpin for TriggerOrder
impl UnwindSafe for TriggerOrder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request