kestrel-chartkitv0.33.0

← All examples

pivots_structure

Swing pivot detection with a rolling structure score

pivots_structure

examples/site_showcase.rs
// Swing pivot detection with a rolling structure score
// Defaults of "pivots_structure" (see the indicator reference)
let params = HashMap::from([
    ("left_bars".to_string(), 5.0),
    ("right_bars".to_string(), 5.0),
    ("score_window".to_string(), 10.0),
]);
let mut indicator = build_checked("pivots_structure", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Swing pivot detection with a rolling structure score. 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.Swing pivot detection with a rolling structure score. 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.
  • Market structure and patterns
  • unit: Unitless