pub enum PriceDirection {
Long,
Short,
}Expand description
Direction of a position or directional signal.
Variants§
Implementations§
Source§impl PriceDirection
impl PriceDirection
pub fn parse(value: &str) -> Option<Self>
pub fn as_str(self) -> &'static str
pub fn pnl(self, entry: f64, exit: f64) -> f64
pub fn favorable(self, entry: f64, high: f64, low: f64) -> f64
pub fn adverse(self, entry: f64, high: f64, low: f64) -> f64
Sourcepub fn update_excursions(
self,
entry: f64,
bar: PriceObservation,
mfe: f64,
mae: f64,
) -> (f64, f64)
pub fn update_excursions( self, entry: f64, bar: PriceObservation, mfe: f64, mae: f64, ) -> (f64, f64)
Extend non-negative running excursions with one completed bar.
Trait Implementations§
Source§impl Clone for PriceDirection
impl Clone for PriceDirection
Source§fn clone(&self) -> PriceDirection
fn clone(&self) -> PriceDirection
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 PriceDirection
Source§impl Debug for PriceDirection
impl Debug for PriceDirection
impl Eq for PriceDirection
Source§impl PartialEq for PriceDirection
impl PartialEq for PriceDirection
impl StructuralPartialEq for PriceDirection
Auto Trait Implementations§
impl Freeze for PriceDirection
impl RefUnwindSafe for PriceDirection
impl Send for PriceDirection
impl Sync for PriceDirection
impl Unpin for PriceDirection
impl UnsafeUnpin for PriceDirection
impl UnwindSafe for PriceDirection
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