pub struct DragonflyDoji { /* private fields */ }Expand description
Dragonfly Doji — a single-bar bullish reversal. Open, close, and high sit at the top of the bar while a long lower shadow shows price was driven down hard and then bid all the way back to the open — buyers rejecting the lows.
range = high − low
doji = |close − open| <= 0.1 * range
no upper wick = high − max(open, close) <= 0.1 * range
long lower = min(open, close) − low >= 0.5 * rangeOutput is +1.0 when the dragonfly prints and 0.0 otherwise. Dragonfly Doji
is a single-direction (bullish-only) shape, so it never emits −1.0. Body and
shadow thresholds follow the geometric house style (fixed fractions of the bar
range) 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 bullish, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, DragonflyDoji, Indicator};
let mut indicator = DragonflyDoji::new();
// Body at the top, long lower shadow.
let candle = Candle::new(10.0, 10.05, 6.0, 10.0, 1.0, 0).unwrap();
assert_eq!(indicator.update(candle), Some(1.0));Implementations§
Source§impl DragonflyDoji
impl DragonflyDoji
Trait Implementations§
Source§impl Clone for DragonflyDoji
impl Clone for DragonflyDoji
Source§fn clone(&self) -> DragonflyDoji
fn clone(&self) -> DragonflyDoji
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 DragonflyDoji
impl Debug for DragonflyDoji
Source§impl Default for DragonflyDoji
impl Default for DragonflyDoji
Source§fn default() -> DragonflyDoji
fn default() -> DragonflyDoji
Source§impl Indicator for DragonflyDoji
impl Indicator for DragonflyDoji
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 DragonflyDoji
impl RefUnwindSafe for DragonflyDoji
impl Send for DragonflyDoji
impl Sync for DragonflyDoji
impl Unpin for DragonflyDoji
impl UnsafeUnpin for DragonflyDoji
impl UnwindSafe for DragonflyDoji
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