pub struct Kicking { /* private fields */ }Expand description
Kicking — a 2-bar reversal of two opposite-coloured marubozu separated by a gap. A shadowless candle is “kicked” the other way by a shadowless candle of the opposite colour that gaps clear of it — a violent change of control. It is trend-agnostic: the gap direction alone defines the signal.
marubozu = |close − open| >= 0.95 * (high − low) (no meaningful shadows)
bullish (+1.0): black marubozu, then a white marubozu gapping UP (low2 > high1)
bearish (−1.0): white marubozu, then a black marubozu gapping DOWN (high2 < low1)Output is +1.0 (bullish) or −1.0 (bearish) when the pattern completes and
0.0 otherwise. The first bar always returns 0.0 because the two-bar window
is not yet filled. The marubozu threshold follows 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 bullish, −1.0 bearish, 0.0 no pattern — so it
drops straight into a machine-learning feature matrix where the two directions
occupy a single dimension.
§Example
use wickra_core::{Candle, Indicator, Kicking};
let mut indicator = Kicking::new();
indicator.update(Candle::new(12.0, 12.0, 10.0, 10.0, 1.0, 0).unwrap());
let out = indicator
.update(Candle::new(14.0, 16.0, 14.0, 16.0, 1.0, 1).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Trait Implementations§
Source§impl Indicator for Kicking
impl Indicator for Kicking
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 Kicking
impl RefUnwindSafe for Kicking
impl Send for Kicking
impl Sync for Kicking
impl Unpin for Kicking
impl UnsafeUnpin for Kicking
impl UnwindSafe for Kicking
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