kestrel-chartkitv0.33.0

← All examples

parabolic_sar

Parabolic SAR

parabolic_sar

examples/site_showcase.rs
// Parabolic SAR
// Defaults of "parabolic_sar" (see the indicator reference)
let params = HashMap::from([
    ("max_step".to_string(), 0.2),
    ("step".to_string(), 0.02),
]);
let mut indicator = build_checked("parabolic_sar", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Parabolic SAR. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 12 alerts in view, the latest as markers.Parabolic SAR. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 12 alerts in view, the latest as markers.
  • Moving averages, bands and trend lines
  • unit: Price