pub struct TdDWave { /* private fields */ }Expand description
Tom DeMark TD D-Wave — a streaming wave counter that labels the market’s
swing sequence with an Elliott-style 1–5 impulse / A–C correction count.
TD D-Wave is DeMark’s objective alternative to discretionary Elliott Wave
counting. This streaming implementation detects alternating swing pivots with a
symmetric fractal of half-width strength, and advances a counter through the
eight-leg cycle each time a new swing leg is confirmed:
legs: 1 → 2 → 3 → 4 → 5 → A(6) → B(7) → C(8) → 1 …
output = current wave number, 1.0..8.0 (6/7/8 = corrective A/B/C)The number tells you which wave of the cycle price is currently working on — a running map of impulse versus correction that updates as each swing confirms. This is a simplified swing-leg count (it does not enforce Elliott’s price ratio and overlap rules); treat it as a structural guide, not a strict wave label.
Readiness is data-dependent: the first value appears once the first swing pivot
confirms (strength bars after it forms). warmup_period returns the minimum
bars to confirm one pivot. Each update is O(strength).
§Example
use wickra_core::{Candle, Indicator, TdDWave};
let mut indicator = TdDWave::new(2).unwrap();
let mut last = None;
for i in 0..120 {
let base = 100.0 + (f64::from(i) * 0.5).sin() * 10.0;
let c = Candle::new(base, base + 1.0, base - 1.0, base, 1_000.0, 0).unwrap();
last = indicator.update(c);
}
let _ = last;Implementations§
Trait Implementations§
Source§impl Indicator for TdDWave
impl Indicator for TdDWave
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 TdDWave
impl RefUnwindSafe for TdDWave
impl Send for TdDWave
impl Sync for TdDWave
impl Unpin for TdDWave
impl UnsafeUnpin for TdDWave
impl UnwindSafe for TdDWave
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