pub struct StopManager {
pub breakeven_trigger_r: Option<f64>,
pub time_stop_bars: Option<u32>,
}Expand description
Break-even and time-stop rule configuration.
Fields§
§breakeven_trigger_r: Option<f64>Move the stop to (at/near) entry once price reaches this R-multiple in favor.
time_stop_bars: Option<u32>Force an exit after this many bars if the trade has not otherwise resolved.
Implementations§
Source§impl StopManager
impl StopManager
Sourcepub fn evaluate(
&self,
entry: f64,
current_price: f64,
risk_per_unit: f64,
bars_held: u32,
is_long: bool,
) -> StopDecision
pub fn evaluate( &self, entry: f64, current_price: f64, risk_per_unit: f64, bars_held: u32, is_long: bool, ) -> StopDecision
Evaluates the current bar against the configured rules. risk_per_unit is the original
|entry - stop| distance (used as the R-multiple denominator); bars_held is elapsed
bars since entry.
Trait Implementations§
Source§impl Clone for StopManager
impl Clone for StopManager
Source§fn clone(&self) -> StopManager
fn clone(&self) -> StopManager
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 StopManager
Source§impl Debug for StopManager
impl Debug for StopManager
Source§impl Default for StopManager
impl Default for StopManager
Source§fn default() -> StopManager
fn default() -> StopManager
Returns the “default value” for a type. Read more
Source§impl PartialEq for StopManager
impl PartialEq for StopManager
impl StructuralPartialEq for StopManager
Auto Trait Implementations§
impl Freeze for StopManager
impl RefUnwindSafe for StopManager
impl Send for StopManager
impl Sync for StopManager
impl Unpin for StopManager
impl UnsafeUnpin for StopManager
impl UnwindSafe for StopManager
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