pub struct RisingThreeMethods { /* private fields */ }Expand description
Rising Three Methods — a 5-bar bullish continuation. A long white candle is followed by three small bars that drift back but stay inside its range (a brief rest), then a second long white candle closes above the first, resuming the advance.
long body = |close − open| >= 0.5 * (high − low)
bar1 white & long
bar2, bar3, bar4 small bodies, each contained within bar1's high/low range
bar5 white, closing above bar1's closeOutput is +1.0 when the pattern completes and 0.0 otherwise. Rising Three
Methods is a single-direction (bullish-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 bullish, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, Indicator, RisingThreeMethods};
let mut indicator = RisingThreeMethods::new();
indicator.update(Candle::new(10.0, 15.1, 9.9, 15.0, 1.0, 0).unwrap());
indicator.update(Candle::new(14.0, 14.1, 12.9, 13.0, 1.0, 1).unwrap());
indicator.update(Candle::new(13.5, 13.6, 12.4, 12.5, 1.0, 2).unwrap());
indicator.update(Candle::new(13.0, 13.1, 11.9, 12.0, 1.0, 3).unwrap());
let out = indicator
.update(Candle::new(12.5, 16.1, 12.4, 16.0, 1.0, 4).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Trait Implementations§
Source§impl Clone for RisingThreeMethods
impl Clone for RisingThreeMethods
Source§fn clone(&self) -> RisingThreeMethods
fn clone(&self) -> RisingThreeMethods
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RisingThreeMethods
impl Debug for RisingThreeMethods
Source§impl Default for RisingThreeMethods
impl Default for RisingThreeMethods
Source§fn default() -> RisingThreeMethods
fn default() -> RisingThreeMethods
Source§impl Indicator for RisingThreeMethods
impl Indicator for RisingThreeMethods
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 RisingThreeMethods
impl RefUnwindSafe for RisingThreeMethods
impl Send for RisingThreeMethods
impl Sync for RisingThreeMethods
impl Unpin for RisingThreeMethods
impl UnsafeUnpin for RisingThreeMethods
impl UnwindSafe for RisingThreeMethods
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