pub struct DownsideGapThreeMethods { /* private fields */ }Expand description
Downside Gap Three Methods — a 3-bar bearish continuation. Two black candles decline with a downside body gap between them, then a white candle opens inside the second body and closes inside the first body, partially filling the gap without erasing the prior decline.
bar1 black, bar2 black
downside body gap: open2 < close1 (bar2's body sits entirely below bar1's)
bar3 white, opens within bar2's body and closes within bar1's bodyOutput is −1.0 when the pattern completes and 0.0 otherwise. Downside Gap
Three Methods is a single-direction (bearish-only) continuation, so it never
emits +1.0; its bullish mirror is crate::UpsideGapThreeMethods. The first
two bars always return 0.0 because the three-bar window is not yet filled.
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, DownsideGapThreeMethods, Indicator};
let mut indicator = DownsideGapThreeMethods::new();
indicator.update(Candle::new(13.0, 13.2, 11.8, 12.0, 1.0, 0).unwrap());
indicator.update(Candle::new(11.0, 11.1, 9.8, 10.0, 1.0, 1).unwrap());
let out = indicator
.update(Candle::new(10.5, 12.6, 10.4, 12.5, 1.0, 2).unwrap());
assert_eq!(out, Some(-1.0));Implementations§
Trait Implementations§
Source§impl Clone for DownsideGapThreeMethods
impl Clone for DownsideGapThreeMethods
Source§fn clone(&self) -> DownsideGapThreeMethods
fn clone(&self) -> DownsideGapThreeMethods
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 DownsideGapThreeMethods
impl Debug for DownsideGapThreeMethods
Source§impl Default for DownsideGapThreeMethods
impl Default for DownsideGapThreeMethods
Source§fn default() -> DownsideGapThreeMethods
fn default() -> DownsideGapThreeMethods
Source§impl Indicator for DownsideGapThreeMethods
impl Indicator for DownsideGapThreeMethods
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 DownsideGapThreeMethods
impl RefUnwindSafe for DownsideGapThreeMethods
impl Send for DownsideGapThreeMethods
impl Sync for DownsideGapThreeMethods
impl Unpin for DownsideGapThreeMethods
impl UnsafeUnpin for DownsideGapThreeMethods
impl UnwindSafe for DownsideGapThreeMethods
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