use crate::candle_indicators::{
pattern_test::EmaState,
registry::CandleBits,
types::{CandleInfo, ForecastType},
};
use tulip_rs_macros::pattern_template;
use super::FIRST;
pub fn info() -> CandleInfo {
CandleInfo {
name: "sourtherndoji",
full_name: "Southern Doji",
forecast: ForecastType::BullishReversal,
extended_pattern: None,
bars: 1,
japanese_name: "Minami no Doji",
}
}
#[pattern_template(
name = "SouthernDoji",
forecast = "BullishReversal",
prev_bar(trend = "DOWN"),
bar(
colour = "RED",
candle_type = "Doji(LongLeggedDoji | DragonflyDoji | GravestoneDoji | Doji)",
body_gap = "GAP_DOWN"
)
)]
pub fn calc(
inputs: (&[f64], &[f64], &[f64], &[f64]),
state: &EmaState,
_bars: &[CandleBits],
) -> bool {
let (_, high, _, _) = inputs;
high[FIRST] <= state.get_ema()
}