swing_structure
Statistical swing structure: the median correction over the median impulse leg
swing_structure
examples/site_showcase.rs// Statistical swing structure: the median correction over the median impulse leg (both in ATRs) as value, with the retracement, remaining potential, required stop, reward-to-risk and impulse velocity in ATRs, the newest three corrections and the trend quality (-1 weakening .. 1 strengthening) as extras
// Defaults of "swing_structure" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("left".to_string(), 5.0),
("max_swings".to_string(), 50.0),
("right".to_string(), 5.0),
]);
let mut indicator = build_checked("swing_structure", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}Not yet verified: no independent second implementation yet.