pub struct Takuri { /* private fields */ }Expand description
Takuri — a single-bar bullish reversal, a stricter Dragonfly Doji. Open, close, and high sit at the very top of the bar with a negligible upper shadow, while an exceptionally long lower shadow shows price was driven sharply down and then bid all the way back — an emphatic rejection of the lows.
range = high − low
doji = |close − open| <= 0.1 * range
negligible upper = high − max(open, close) <= 0.05 * range
very long lower = min(open, close) − low >= 0.7 * rangeOutput is +1.0 when the Takuri prints and 0.0 otherwise. Takuri is a
single-direction (bullish-only) shape, so it never emits −1.0. Its tighter
upper-shadow and longer lower-shadow thresholds make it a strict subset of
crate::DragonflyDoji. Body and shadow thresholds follow the geometric house
style (fixed fractions of the bar range) 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, 0.0 no pattern — so it drops straight into
a machine-learning feature matrix as a single dimension.
§Example
use wickra_core::{Candle, Indicator, Takuri};
let mut indicator = Takuri::new();
// Body at the top, very long lower shadow.
let candle = Candle::new(10.0, 10.05, 7.0, 10.0, 1.0, 0).unwrap();
assert_eq!(indicator.update(candle), Some(1.0));Implementations§
Trait Implementations§
Source§impl Indicator for Takuri
impl Indicator for Takuri
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 Takuri
impl RefUnwindSafe for Takuri
impl Send for Takuri
impl Sync for Takuri
impl Unpin for Takuri
impl UnsafeUnpin for Takuri
impl UnwindSafe for Takuri
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