pub struct StopAttachment {
pub trigger_price: Price,
pub kind: StopKind,
}Expand description
Stop-order attachment on an Order.
See StopKind for variants. Use
ExchangeClient::supports with
Capability::StopOrders to check
adapter capability before constructing one.
Fields§
§trigger_price: PricePrice at which the exchange triggers the stop.
kind: StopKindWhat kind of stop to fire on trigger.
Implementations§
Source§impl StopAttachment
impl StopAttachment
Sourcepub fn stop_market(trigger_price: Price) -> StopAttachment
pub fn stop_market(trigger_price: Price) -> StopAttachment
Convenience: stop-market at trigger_price.
Sourcepub fn stop_limit(trigger_price: Price, limit_price: Price) -> StopAttachment
pub fn stop_limit(trigger_price: Price, limit_price: Price) -> StopAttachment
Convenience: stop-limit triggered at trigger_price, posted at limit_price.
Sourcepub fn take_profit(trigger_price: Price) -> StopAttachment
pub fn take_profit(trigger_price: Price) -> StopAttachment
Convenience: take-profit market order at trigger_price.
Sourcepub fn trailing(trigger_price: Price, trail_distance: Price) -> StopAttachment
pub fn trailing(trigger_price: Price, trail_distance: Price) -> StopAttachment
Convenience: trailing stop with the given trail distance.
Trait Implementations§
Source§impl Clone for StopAttachment
impl Clone for StopAttachment
Source§fn clone(&self) -> StopAttachment
fn clone(&self) -> StopAttachment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StopAttachment
Source§impl Debug for StopAttachment
impl Debug for StopAttachment
Source§impl<'de> Deserialize<'de> for StopAttachment
impl<'de> Deserialize<'de> for StopAttachment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StopAttachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StopAttachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StopAttachment
impl PartialEq for StopAttachment
Source§fn eq(&self, other: &StopAttachment) -> bool
fn eq(&self, other: &StopAttachment) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for StopAttachment
impl Serialize for StopAttachment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for StopAttachment
Auto Trait Implementations§
impl Freeze for StopAttachment
impl RefUnwindSafe for StopAttachment
impl Send for StopAttachment
impl Sync for StopAttachment
impl Unpin for StopAttachment
impl UnsafeUnpin for StopAttachment
impl UnwindSafe for StopAttachment
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