#[non_exhaustive]pub struct TrailingStop {
pub trail_by_ticks: i32,
pub trail_by_price_id: i32,
}Expand description
Configuration for trailing stop orders.
Used both by RithmicOrder::trailing_stop
for a standalone order and by
RithmicOcoOrderLeg::trailing_stop
for a single leg of an OCO group.
§Example
use rithmic_rs::TrailingStop;
let trailing = TrailingStop::new()
.trail_by_ticks(20)
.trail_by_price_id(1)
.build()?;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.trail_by_ticks: i32Number of ticks to trail behind the market price
trail_by_price_id: i32Rithmic price-id to trail against. build() requires a non-zero id.
Implementations§
Source§impl TrailingStop
impl TrailingStop
Sourcepub fn trail_by_ticks(self, trail_by_ticks: i32) -> Self
pub fn trail_by_ticks(self, trail_by_ticks: i32) -> Self
Number of ticks to trail behind the market price.
Sourcepub fn trail_by_price_id(self, trail_by_price_id: i32) -> Self
pub fn trail_by_price_id(self, trail_by_price_id: i32) -> Self
Rithmic price-id to trail against.
Sourcepub fn build(self) -> Result<Self, RithmicError>
pub fn build(self) -> Result<Self, RithmicError>
Requires both fields.
Trait Implementations§
Source§impl Clone for TrailingStop
impl Clone for TrailingStop
Source§fn clone(&self) -> TrailingStop
fn clone(&self) -> TrailingStop
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 moreSource§impl Debug for TrailingStop
impl Debug for TrailingStop
Source§impl<'de> Deserialize<'de> for TrailingStop
impl<'de> Deserialize<'de> for TrailingStop
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TrailingStop
impl PartialEq for TrailingStop
Source§impl Serialize for TrailingStop
impl Serialize for TrailingStop
impl StructuralPartialEq for TrailingStop
Auto Trait Implementations§
impl Freeze for TrailingStop
impl RefUnwindSafe for TrailingStop
impl Send for TrailingStop
impl Sync for TrailingStop
impl Unpin for TrailingStop
impl UnsafeUnpin for TrailingStop
impl UnwindSafe for TrailingStop
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