use super::FIRST;
use crate::candle_indicators::registry::CandleBits;
use crate::candle_indicators::{
common::{cdl_wick_length, LONG},
pattern_test::EmaState,
types::{CandleInfo, ForecastType},
};
use tulip_rs_macros::pattern_template;
pub fn info() -> CandleInfo {
CandleInfo {
name: "bullishbelthold",
full_name: "Bullish Belt Hold",
forecast: ForecastType::BullishReversal,
extended_pattern: None,
bars: 1,
japanese_name: "Yorikiri",
}
}
#[pattern_template(
name = "BullishBeltHold",
forecast = "BullishReversal",
prev_bar(trend = "DOWN"),
bar(
fill = "HALLOW",
line_height = "LONG",
upper_wick_lt_body = "TRUE",
candle_type = "Marubozu(OpeningWhiteMarubozu)"
)
)]
pub fn calc(
inputs: (&[f64], &[f64], &[f64], &[f64]),
_state: &EmaState,
_bars: &[CandleBits],
) -> bool {
let (open, high, _, close) = inputs;
if cdl_wick_length((open[FIRST], close[FIRST]), high[FIRST], Some(0.25000001)) == LONG {
return false;
}
true
}