nadaraya_watson
Gaussian kernel regression of the close at the newest bar, with an envelope of mult mean absolute errors
nadaraya_watson
examples/site_showcase.rs// Gaussian kernel regression of the close at the newest bar, with an envelope of `mult` mean absolute errors (extras `upper`, `lower`). Only past bars are used, so a value never changes later. Published from bar 2 * lookback - 1.
// Defaults of "nadaraya_watson" (see the indicator reference)
let params = HashMap::from([
("bandwidth".to_string(), 8.0),
("lookback".to_string(), 50.0),
("mult".to_string(), 3.0),
]);
let mut indicator = build_checked("nadaraya_watson", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}