pub struct HikkakeModified { /* private fields */ }Expand description
Modified Hikkake — Dan Chesler’s refinement of the Hikkake
trap (TA-Lib CDLHIKKAKEMOD). Two nested inside bars coil the market; the
first inside bar already closes at the extreme the false break will run
towards, and the fourth bar breaks out of the second inside bar the wrong way.
bar2 inside bar1 : high2 < high1 && low2 > low1
bar3 inside bar2 : high3 < high2 && low3 > low2
bullish (+1.0): bar4 makes a lower high AND lower low than bar3,
and bar2 closed near its low (close2 <= low2 + 0.2 · range2)
bearish (−1.0): bar4 makes a higher high AND higher low than bar3,
and bar2 closed near its high (close2 >= high2 − 0.2 · range2)Output is +1.0 (bullish), −1.0 (bearish), or 0.0 otherwise. “Near” is a
fixed fifth of the second bar’s range (TA-Lib’s Near factor of 0.2 applied
geometrically rather than to a rolling average). The first three bars return
None because the four-bar window is not yet filled. The later confirmation
bar is not flagged separately. 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, −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, HikkakeModified, Indicator};
let mut indicator = HikkakeModified::new();
indicator.update(Candle::new(10.0, 15.0, 5.0, 12.0, 1.0, 0).unwrap());
indicator.update(Candle::new(11.0, 13.0, 7.0, 7.5, 1.0, 1).unwrap());
indicator.update(Candle::new(9.0, 12.0, 8.0, 10.0, 1.0, 2).unwrap());
let out = indicator
.update(Candle::new(9.0, 11.0, 6.0, 9.0, 1.0, 3).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Trait Implementations§
Source§impl Clone for HikkakeModified
impl Clone for HikkakeModified
Source§impl Debug for HikkakeModified
impl Debug for HikkakeModified
Source§impl Default for HikkakeModified
impl Default for HikkakeModified
Source§impl Indicator for HikkakeModified
impl Indicator for HikkakeModified
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 there is no value for this input. Read moreSource§fn reset(&mut self)
fn reset(&mut self)
Source§fn warmup_period(&self) -> usize
fn warmup_period(&self) -> usize
None output can be produced.Source§fn is_ready(&self) -> bool
fn is_ready(&self) -> bool
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Source§fn batch_nan_into(&mut self, inputs: &[Self::Input], out: &mut [f64])
fn batch_nan_into(&mut self, inputs: &[Self::Input], out: &mut [f64])
Source§fn batch_fast_into(&mut self, inputs: &[Self::Input], out: &mut [f64])
fn batch_fast_into(&mut self, inputs: &[Self::Input], out: &mut [f64])
batch_nan_into, but
an indicator with a vectorised kernel may reassociate its arithmetic to
run it in SIMD lanes. Each value then agrees with the exact batch to within
the tolerance the indicator documents (a few units in the last place), not
bit for bit; warmup positions, NaN placement and the output length are
identical. The kernels are deterministic: the same input produces the same
bits on every platform, with or without SIMD hardware. Read moreAuto Trait Implementations§
impl Freeze for HikkakeModified
impl RefUnwindSafe for HikkakeModified
impl Send for HikkakeModified
impl Sync for HikkakeModified
impl Unpin for HikkakeModified
impl UnsafeUnpin for HikkakeModified
impl UnwindSafe for HikkakeModified
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