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