roofing_filter
Ehlers' Roofing Filter: a two-pole high-pass filter
roofing_filter
examples/site_showcase.rs// Ehlers' Roofing Filter: a two-pole high-pass filter (cutoff hp_period) followed by a SuperSmoother (lp_period); an oscillator around 0 on the price scale, published from the hp_period-th bar. The high-pass is 0 on the first two bars and the SuperSmoother starts from it. The coefficients use pi in full, where Ehlers' listings truncate it to 3.14159 in the exponent.
// Defaults of "roofing_filter" (see the indicator reference)
let params = HashMap::from([
("hp_period".to_string(), 48.0),
("lp_period".to_string(), 10.0),
]);
let mut indicator = build_checked("roofing_filter", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}