kestrel-chartkitv0.49.0

← All examples

kestrel_vwap_regime

Kestrel VWAP as a regime reading: the distance of the close from the rolling VWAP in ATRs as value, with vw…

kestrel_vwap_regime

examples/site_showcase.rs
// Kestrel VWAP as a regime reading: the distance of the close from the rolling VWAP in ATRs as value, with vwap, slope_atr, slope_state (-2..2), cross_frequency and price_persistence as extras, plus z_score while the VWAP sigma is positive; needs real volume
// Defaults of "kestrel_vwap_regime" (see the indicator reference)
let params = HashMap::from([
    ("atr_len".to_string(), 14.0),
    ("flat_threshold".to_string(), 0.1),
    ("regime_window".to_string(), 20.0),
    ("slope_lookback".to_string(), 20.0),
    ("strong_threshold".to_string(), 0.3),
    ("window".to_string(), 390.0),
]);
let mut indicator = build_checked("kestrel_vwap_regime", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Kestrel VWAP as a regime reading: the distance of the close from the rolling VWAP in ATRs as value, with vwap, slope_atr, slope_state (-2..2), cross_frequency and price_persistence as extras, plus z_score while the VWAP sigma is positive; needs real volume. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.Kestrel VWAP as a regime reading: the distance of the close from the rolling VWAP in ATRs as value, with vwap, slope_atr, slope_state (-2..2), cross_frequency and price_persistence as extras, plus z_score while the VWAP sigma is positive; needs real volume. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.
  • Volume
  • unit: Unitless