kestrel-chartkitv0.33.0

← All examples

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", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.
  • Composite read-outs, part 2
  • unit: Ratio