pub struct SeparatingLines { /* private fields */ }Expand description
Separating Lines — a 2-bar continuation. After a counter-trend candle, the next candle of the opposite colour opens right back at the prior open and runs as an opening marubozu in the trend direction, so the trend “separates” from the pullback and resumes.
long body = |close − open| >= 0.5 * (high − low)
bar1, bar2 opposite colours
bar2 opens at bar1's open (|open2 − open1| <= 0.05 · range1)
bar2 is a long opening marubozu in its direction
white bar2: open2 == low2 (no lower shadow) -> +1.0
black bar2: open2 == high2 (no upper shadow) -> −1.0Output is +1.0 (bullish continuation) or −1.0 (bearish continuation) when
the pattern completes and 0.0 otherwise. The first bar always returns 0.0
because the two-bar window is not yet filled. Open-equality and marubozu
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 directions
occupy a single dimension.
§Example
use wickra_core::{Candle, Indicator, SeparatingLines};
let mut indicator = SeparatingLines::new();
indicator.update(Candle::new(12.0, 12.1, 9.9, 10.0, 1.0, 0).unwrap());
let out = indicator
.update(Candle::new(12.0, 14.1, 12.0, 14.0, 1.0, 1).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Trait Implementations§
Source§impl Clone for SeparatingLines
impl Clone for SeparatingLines
Source§fn clone(&self) -> SeparatingLines
fn clone(&self) -> SeparatingLines
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 SeparatingLines
impl Debug for SeparatingLines
Source§impl Default for SeparatingLines
impl Default for SeparatingLines
Source§fn default() -> SeparatingLines
fn default() -> SeparatingLines
Source§impl Indicator for SeparatingLines
impl Indicator for SeparatingLines
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 SeparatingLines
impl RefUnwindSafe for SeparatingLines
impl Send for SeparatingLines
impl Sync for SeparatingLines
impl Unpin for SeparatingLines
impl UnsafeUnpin for SeparatingLines
impl UnwindSafe for SeparatingLines
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