pub struct LongLeggedDoji { /* private fields */ }Expand description
Long-Legged Doji — a single-bar indecision signal. A doji with long shadows on both sides: price ranged widely up and down yet closed essentially where it opened, a tug-of-war that often precedes a turn.
range = high − low
doji = |close − open| <= 0.1 * range
long upper = high − max(open, close) >= 0.3 * range
long lower = min(open, close) − low >= 0.3 * rangeOutput is +1.0 when the long-legged doji prints and 0.0 otherwise. This is
a non-directional indecision flag — it never emits −1.0 (use
DragonflyDoji / GravestoneDoji for the directional single-shadow variants).
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 detected, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, LongLeggedDoji, Indicator};
let mut indicator = LongLeggedDoji::new();
// Tiny body, long shadows on both sides.
let candle = Candle::new(10.0, 12.0, 8.0, 10.05, 1.0, 0).unwrap();
assert_eq!(indicator.update(candle), Some(1.0));Implementations§
Trait Implementations§
Source§impl Clone for LongLeggedDoji
impl Clone for LongLeggedDoji
Source§fn clone(&self) -> LongLeggedDoji
fn clone(&self) -> LongLeggedDoji
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 LongLeggedDoji
impl Debug for LongLeggedDoji
Source§impl Default for LongLeggedDoji
impl Default for LongLeggedDoji
Source§fn default() -> LongLeggedDoji
fn default() -> LongLeggedDoji
Source§impl Indicator for LongLeggedDoji
impl Indicator for LongLeggedDoji
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 LongLeggedDoji
impl RefUnwindSafe for LongLeggedDoji
impl Send for LongLeggedDoji
impl Sync for LongLeggedDoji
impl Unpin for LongLeggedDoji
impl UnsafeUnpin for LongLeggedDoji
impl UnwindSafe for LongLeggedDoji
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