pub struct ThreeStarsInSouth { /* private fields */ }Expand description
Three Stars in the South — a rare 3-bar bullish reversal: three shrinking red candles where each session carves out a higher low and contracts toward a tiny black marubozu, signalling exhausted selling at the bottom of a decline.
tol = tolerance * max(|bar3.high|, |bar3.low|)
all three red (close < open)
bar1 long lower shadow (bar1.close − bar1.low) >= (bar1.open − bar1.close)
bar2 opens inside bar1's body, higher low, smaller body, closes above bar1.close
bar3 small black marubozu (upper & lower shadow <= tol) inside bar2's rangeOutput is +1.0 when the pattern completes and 0.0 otherwise. Three Stars
in the South is a single-direction (bullish-only) pattern, so it never emits
−1.0. The first two bars always return 0.0 because the three-bar window
is not yet filled. tolerance defaults to 0.001 (10 bps relative) and must
lie in [0, 1). 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, ThreeStarsInSouth};
let mut indicator = ThreeStarsInSouth::new();
indicator.update(Candle::new(20.0, 20.1, 8.0, 15.0, 1.0, 0).unwrap());
indicator.update(Candle::new(18.0, 18.1, 12.0, 16.0, 1.0, 1).unwrap());
let out = indicator
.update(Candle::new(15.0, 15.0, 14.0, 14.0, 1.0, 2).unwrap());
assert_eq!(out, Some(1.0));Implementations§
Source§impl ThreeStarsInSouth
impl ThreeStarsInSouth
Sourcepub fn with_tolerance(tolerance: f64) -> Result<Self>
pub fn with_tolerance(tolerance: f64) -> Result<Self>
Construct a detector with a custom relative tolerance.
tolerance must lie in [0, 1).
Trait Implementations§
Source§impl Clone for ThreeStarsInSouth
impl Clone for ThreeStarsInSouth
Source§fn clone(&self) -> ThreeStarsInSouth
fn clone(&self) -> ThreeStarsInSouth
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 ThreeStarsInSouth
impl Debug for ThreeStarsInSouth
Source§impl Default for ThreeStarsInSouth
impl Default for ThreeStarsInSouth
Source§impl Indicator for ThreeStarsInSouth
impl Indicator for ThreeStarsInSouth
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 ThreeStarsInSouth
impl RefUnwindSafe for ThreeStarsInSouth
impl Send for ThreeStarsInSouth
impl Sync for ThreeStarsInSouth
impl Unpin for ThreeStarsInSouth
impl UnsafeUnpin for ThreeStarsInSouth
impl UnwindSafe for ThreeStarsInSouth
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