pub struct HighWave { /* private fields */ }Expand description
High-Wave — a single-bar extreme-indecision signal. A small body with very long shadows on both sides: price swung far up and far down yet finished near the open, a sign that trend conviction has evaporated.
range = high − low
long upper = high − max(open, close) >= 0.4 * range
long lower = min(open, close) − low >= 0.4 * rangeThe two long-shadow conditions force the body below 0.2 * range, so no
separate body test is needed. Output is +1.0 when the high-wave prints and
0.0 otherwise — a non-directional indecision flag, it never emits −1.0.
Shadow 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 detected, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, HighWave, Indicator};
let mut indicator = HighWave::new();
// Small body, long shadows both sides.
let candle = Candle::new(10.0, 12.0, 8.0, 10.3, 1.0, 0).unwrap();
assert_eq!(indicator.update(candle), Some(1.0));Implementations§
Trait Implementations§
Source§impl Indicator for HighWave
impl Indicator for HighWave
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 HighWave
impl RefUnwindSafe for HighWave
impl Send for HighWave
impl Sync for HighWave
impl Unpin for HighWave
impl UnsafeUnpin for HighWave
impl UnwindSafe for HighWave
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