leg_conviction
Leg Conviction: each confirmed pivot-to-pivot leg scored 0..100 from speed
leg_conviction
examples/site_showcase.rs// Leg Conviction: each confirmed pivot-to-pivot leg scored 0..100 from speed (ATR per bar against speed_ref), cleanliness (share of closes in leg direction) and volume gradient (later vs. earlier half; weight 0 without real volume); value = last up-leg conviction, secondary = minus last down-leg conviction; extra: bull_last, bull_prev, bear_last, bear_prev, pivot_price on alert bars; alerts bear/bull_conviction_divergence (new price extreme on a weaker leg, prefix = expected move)
// Defaults of "leg_conviction" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("max_leg".to_string(), 100.0),
("pivot_left".to_string(), 5.0),
("pivot_right".to_string(), 5.0),
("speed_ref".to_string(), 1.0),
("w_clean".to_string(), 0.4),
("w_speed".to_string(), 0.4),
("w_volume".to_string(), 0.2),
]);
let mut indicator = build_checked("leg_conviction", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}