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: "bearishbelthold",
full_name: "Bearish Belt Hold",
forecast: ForecastType::BearishReversal,
extended_pattern: None,
bars: 1,
japanese_name: "Yorikiri",
}
}
#[pattern_template(
name = "BearishBelthold",
forecast = "BearishReversal",
prev_bar(trend = "UP"),
bar(
fill = "FILL",
line_height = "LONG",
lower_wick_lt_body = "TRUE",
candle_type = "Marubozu(OpeningBlackMarubozu)"
)
)]
pub fn calc(
inputs: (&[f64], &[f64], &[f64], &[f64]),
_state: &EmaState,
_bars: &[CandleBits],
) -> bool {
let (open, _, low, close) = inputs;
if cdl_wick_length((open[FIRST], close[FIRST]), low[FIRST], Some(0.25000001)) == LONG {
return false;
}
true
}