pub struct GapSideBySideWhite { /* private fields */ }Expand description
Gap Side-by-Side White Lines — a 3-bar continuation. After a gap away from the first bar, two white candles of similar size open at roughly the same level (side by side) and hold the gap open, signalling the trend resumes in the gap direction.
bar2, bar3 both white
bar2 body gaps away from bar1 body (up or down)
bar3 opens beside bar2 (|open3 − open2| <= 0.1 · range2)
bar3 body is similar in size to bar2 (neither more than twice the other)
gap up -> +1.0 (bullish continuation)
gap down -> −1.0 (bearish continuation — "downside" gap side-by-side white)Output is +1.0 (gap up) or −1.0 (gap down) when the pattern completes and
0.0 otherwise. The first two bars always return 0.0 because the three-bar
window is not yet filled. Open-equality and body-similarity 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, −1.0 bearish, 0.0 no pattern — so it
drops straight into a machine-learning feature matrix where the two gap
directions occupy a single dimension.
§Example
use wickra_core::{Candle, GapSideBySideWhite, Indicator};
let mut indicator = GapSideBySideWhite::new();
indicator.update(Candle::new(10.0, 11.1, 9.9, 11.0, 1.0, 0).unwrap());
indicator.update(Candle::new(13.0, 14.1, 12.9, 14.0, 1.0, 1).unwrap());
let out = indicator
.update(Candle::new(13.0, 14.1, 12.9, 14.0, 1.0, 2).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Trait Implementations§
Source§impl Clone for GapSideBySideWhite
impl Clone for GapSideBySideWhite
Source§fn clone(&self) -> GapSideBySideWhite
fn clone(&self) -> GapSideBySideWhite
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 GapSideBySideWhite
impl Debug for GapSideBySideWhite
Source§impl Default for GapSideBySideWhite
impl Default for GapSideBySideWhite
Source§fn default() -> GapSideBySideWhite
fn default() -> GapSideBySideWhite
Source§impl Indicator for GapSideBySideWhite
impl Indicator for GapSideBySideWhite
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 GapSideBySideWhite
impl RefUnwindSafe for GapSideBySideWhite
impl Send for GapSideBySideWhite
impl Sync for GapSideBySideWhite
impl Unpin for GapSideBySideWhite
impl UnsafeUnpin for GapSideBySideWhite
impl UnwindSafe for GapSideBySideWhite
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