reflex
Ehlers' Reflex: the deviation of a SuperSmoother
reflex
examples/site_showcase.rs// Ehlers' Reflex: the deviation of a SuperSmoother (period length / 2) from the line through its value `length` bars ago, normalised by its root mean square; published from bar length + 1. The SuperSmoother starts from the first two closes (Ehlers' listing from 0), and a sum within rounding of zero counts as 0. The coefficients use pi in full, where Ehlers' listings truncate it to 3.14159 in the exponent.
// Defaults of "reflex" (see the indicator reference)
let params = HashMap::from([
("length".to_string(), 20.0),
]);
let mut indicator = build_checked("reflex", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}