pub struct FallingThreeMethods { /* private fields */ }Expand description
Falling Three Methods — a 5-bar bearish continuation. A long black candle is
followed by three small white bars that drift up but stay inside its range (a
brief rest), then a second long black candle opens below the last rest bar’s
close and closes below the first, resuming the decline (Nison; TA-Lib
CDLRISEFALL3METHODS).
long body = |close − open| >= 0.5 * (high − low)
small body = |close − open| <= 0.5 * body1
bar1 black & long
bar2, bar3, bar4 small white bodies, each overlapping bar1's high/low range
(min(open, close) < high1 and max(open, close) > low1),
with rising closes (close3 > close2, close4 > close3)
bar5 black & long, opening below bar4's close (open5 < close4)
and closing below bar1's close (close5 < close1)Output is −1.0 when the pattern completes and 0.0 otherwise. Falling Three
Methods is a single-direction (bearish-only) continuation, so it never emits
+1.0. The first four bars always return 0.0 because the five-bar window is
not yet filled. Body 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 bearish, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, FallingThreeMethods, Indicator};
let mut indicator = FallingThreeMethods::new();
indicator.update(Candle::new(15.0, 15.1, 9.9, 10.0, 1.0, 0).unwrap());
indicator.update(Candle::new(11.0, 12.1, 10.9, 12.0, 1.0, 1).unwrap());
indicator.update(Candle::new(11.5, 12.6, 11.4, 12.5, 1.0, 2).unwrap());
indicator.update(Candle::new(12.0, 13.1, 11.9, 13.0, 1.0, 3).unwrap());
let out = indicator
.update(Candle::new(12.5, 12.6, 8.9, 9.0, 1.0, 4).unwrap());
assert_eq!(out, Some(-1.0));Implementations§
Trait Implementations§
Source§impl Clone for FallingThreeMethods
impl Clone for FallingThreeMethods
Source§impl Debug for FallingThreeMethods
impl Debug for FallingThreeMethods
Source§impl Default for FallingThreeMethods
impl Default for FallingThreeMethods
Source§impl Indicator for FallingThreeMethods
impl Indicator for FallingThreeMethods
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 FallingThreeMethods
impl RefUnwindSafe for FallingThreeMethods
impl Send for FallingThreeMethods
impl Sync for FallingThreeMethods
impl Unpin for FallingThreeMethods
impl UnsafeUnpin for FallingThreeMethods
impl UnwindSafe for FallingThreeMethods
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