pub struct EveningDojiStar { /* private fields */ }Expand description
Evening Doji Star — a 3-bar bearish top reversal. A long white bar extends the advance, a doji gaps up above it (the star of indecision), then a black bar gaps back down and closes deep into the first body, confirming the turn.
long body = |close − open| >= 0.5 * (high − low)
doji = |close − open| <= 0.1 * (high − low)
bar1 white & long
bar2 doji, body gaps UP above bar1 body (min(o2,c2) > close1)
bar3 black, body gaps DOWN below the doji (max(o3,c3) < min(o2,c2))
bar3 closes deep into bar1 body (close3 < close1 − penetration·body1)Output is −1.0 when the pattern completes and 0.0 otherwise. Evening Doji
Star is a single-direction (bearish-only) reversal, so it never emits +1.0.
The first two bars always return 0.0 because the three-bar window is not yet
filled. penetration is how far into the first body the third bar must close;
it defaults to 0.3 (TA-Lib’s CDLEVENINGDOJISTAR default) and must lie in
[0, 1). Body and doji thresholds follow the geometric house style rather than
TA-Lib’s rolling averages. Pattern-shape check only — no trend filter is
applied; combine with a trend indicator for actionable signals.
§Signed ±1 encoding
This detector emits the uniform candlestick sign convention shared across the
pattern family — −1.0 bearish, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, EveningDojiStar, Indicator};
let mut indicator = EveningDojiStar::new();
indicator.update(Candle::new(10.0, 15.1, 9.9, 15.0, 1.0, 0).unwrap());
indicator.update(Candle::new(17.0, 17.1, 16.9, 17.0, 1.0, 1).unwrap());
let out = indicator
.update(Candle::new(16.0, 16.1, 11.9, 12.0, 1.0, 2).unwrap());
assert_eq!(out, Some(-1.0));Implementations§
Source§impl EveningDojiStar
impl EveningDojiStar
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct an Evening Doji Star detector with the default 0.3 penetration.
Sourcepub fn with_penetration(penetration: f64) -> Result<Self>
pub fn with_penetration(penetration: f64) -> Result<Self>
Construct an Evening Doji Star detector with a custom penetration fraction.
penetration must lie in [0, 1).
Sourcepub fn penetration(&self) -> f64
pub fn penetration(&self) -> f64
Configured penetration fraction.
Trait Implementations§
Source§impl Clone for EveningDojiStar
impl Clone for EveningDojiStar
Source§fn clone(&self) -> EveningDojiStar
fn clone(&self) -> EveningDojiStar
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EveningDojiStar
impl Debug for EveningDojiStar
Source§impl Default for EveningDojiStar
impl Default for EveningDojiStar
Source§impl Indicator for EveningDojiStar
impl Indicator for EveningDojiStar
Source§type Input = Candle
type Input = Candle
f64 for a price, or Candle / Tick).Source§fn update(&mut self, candle: Candle) -> Option<f64>
fn update(&mut self, candle: Candle) -> Option<f64>
None if the indicator is still warming up.Source§fn reset(&mut self)
fn reset(&mut self)
Source§fn warmup_period(&self) -> usize
fn warmup_period(&self) -> usize
None output can be produced.Auto Trait Implementations§
impl Freeze for EveningDojiStar
impl RefUnwindSafe for EveningDojiStar
impl Send for EveningDojiStar
impl Sync for EveningDojiStar
impl Unpin for EveningDojiStar
impl UnsafeUnpin for EveningDojiStar
impl UnwindSafe for EveningDojiStar
Blanket Implementations§
Source§impl<T> BatchExt for Twhere
T: Indicator,
impl<T> BatchExt for Twhere
T: Indicator,
Source§fn batch(&mut self, inputs: &[Self::Input]) -> Vec<Option<Self::Output>>
fn batch(&mut self, inputs: &[Self::Input]) -> Vec<Option<Self::Output>>
None during warmup) per input.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more