tradability_filter
Tradability Filter: no-trade filter with an eight-state machine
tradability_filter
examples/site_showcase.rs// Tradability Filter: no-trade filter with an eight-state machine (no_trade, balance, compression, ready, breakout, trend, aftermath, exhaustion) driven by rank-normalised tradability, balance, compression and direction scores; value = tradability 0..100, secondary = direction -100..100; extra: balance, compression, direction, state_code, candidate_code, efficiency, fast_efficiency, adx, range_high, range_low, range_position, atr_ratio; alerts on entering a state: no_trade, compression, aftermath (warnings), bull/bear_ready, bull/bear_breakout, bull/bear_trend, bear/bull_exhaustion (prefix = expected move)
// Defaults of "tradability_filter" (see the indicator reference)
let params = HashMap::from([
("balance_threshold".to_string(), 58.0),
("baseline_len".to_string(), 34.0),
("compression_threshold".to_string(), 62.0),
("confirm_bars".to_string(), 2.0),
("max_range_atr".to_string(), 7.0),
("quality_len".to_string(), 20.0),
("range_len".to_string(), 30.0),
("rank_len".to_string(), 150.0),
]);
let mut indicator = build_checked("tradability_filter", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}