pub enum TrailMethod {
Fixed(i64),
Percentage(f64),
Atr {
multiplier: f64,
period: usize,
},
}Expand description
Method used to compute the trailing stop offset.
Variants§
Fixed(i64)
Fixed offset in cents (e.g., 200 = $2.00 trailing distance).
Percentage(f64)
Percentage of the watermark price (e.g., 0.02 = 2% trailing distance).
Atr
ATR-based: multiplier × ATR(period).
ATR is computed internally from trade price changes.
period is the lookback window size for the moving average.
Trait Implementations§
Source§impl Clone for TrailMethod
impl Clone for TrailMethod
Source§fn clone(&self) -> TrailMethod
fn clone(&self) -> TrailMethod
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 moreSource§impl Debug for TrailMethod
impl Debug for TrailMethod
Source§impl PartialEq for TrailMethod
impl PartialEq for TrailMethod
impl StructuralPartialEq for TrailMethod
Auto Trait Implementations§
impl Freeze for TrailMethod
impl RefUnwindSafe for TrailMethod
impl Send for TrailMethod
impl Sync for TrailMethod
impl Unpin for TrailMethod
impl UnsafeUnpin for TrailMethod
impl UnwindSafe for TrailMethod
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