pub struct StalledPattern { /* private fields */ }Expand description
Stalled Pattern (also called Deliberation) — a 3-bar bearish reversal warning. Two long white candles push higher, then a small-bodied white candle opens at or near the top of the second body and barely advances — the rally is running out of breath, hinting that buyers are losing control.
long body = |close − open| >= 0.5 * (high − low)
small body = |close − open| <= 0.3 * (high − low)
bar1, bar2 long white; bar3 small white
rising closes: close3 > close2 > close1
bar3 rides the shoulder: open3 >= close2 − 0.1 * (high2 − low2)Output is −1.0 when the pattern completes and 0.0 otherwise. Stalled Pattern
is a single-direction (bearish-only) warning, so it never emits +1.0. The
first two bars always return 0.0 because the three-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, Indicator, StalledPattern};
let mut indicator = StalledPattern::new();
indicator.update(Candle::new(10.0, 12.05, 9.9, 12.0, 1.0, 0).unwrap());
indicator.update(Candle::new(11.0, 14.05, 10.9, 14.0, 1.0, 1).unwrap());
let out = indicator
.update(Candle::new(14.0, 14.6, 13.95, 14.15, 1.0, 2).unwrap());
assert_eq!(out, Some(-1.0));Implementations§
Trait Implementations§
Source§impl Clone for StalledPattern
impl Clone for StalledPattern
Source§fn clone(&self) -> StalledPattern
fn clone(&self) -> StalledPattern
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 StalledPattern
impl Debug for StalledPattern
Source§impl Default for StalledPattern
impl Default for StalledPattern
Source§fn default() -> StalledPattern
fn default() -> StalledPattern
Source§impl Indicator for StalledPattern
impl Indicator for StalledPattern
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 StalledPattern
impl RefUnwindSafe for StalledPattern
impl Send for StalledPattern
impl Sync for StalledPattern
impl Unpin for StalledPattern
impl UnsafeUnpin for StalledPattern
impl UnwindSafe for StalledPattern
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