Skip to main content

Breakout

Struct Breakout 

Source
pub struct Breakout { /* private fields */ }
Expand description

Emit a breakout when the input rises above upper (long) or falls below lower (short). Inputs are (value, upper, lower) triplets — caller is responsible for feeding the channel from crate::indicators::volatility::Donchian or similar.

Implementations§

Source§

impl Breakout

Source

pub fn new() -> Self

Create a new breakout detector.

Trait Implementations§

Source§

impl Debug for Breakout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Breakout

Source§

fn default() -> Breakout

Returns the “default value” for a type. Read more
Source§

impl Signal for Breakout

Source§

type Input = (f64, f64, f64)

Type fed into the signal each bar.
Source§

fn next( &mut self, (value, upper, lower): (f64, f64, f64), ) -> Option<SignalEvent>

Process the next bar and return the resulting event (if any).
Source§

fn reset(&mut self)

Reset the internal state.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S> SignalExt for S
where S: Signal,

Source§

fn and<O>(self, other: O) -> AndSignal<Self, O>
where O: Signal<Input = Self::Input>,

Logical AND: emit Long/Short only if both legs agree this bar.
Source§

fn or<O>(self, other: O) -> OrSignal<Self, O>
where O: Signal<Input = Self::Input>,

Logical OR: emit the first non-None, non-Hold event from either leg.
Source§

fn not(self) -> NotSignal<Self>

Logical NOT: flip LongShort, leave Exit / Hold / None unchanged.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.