r_squared
R-squared of a least-squares line through the last period closes, 1 for a clean straight trend and near 0 f…
r_squared
examples/site_showcase.rs// R-squared of a least-squares line through the last period closes, 1 for a clean straight trend and near 0 for noise; a window of equal closes reads 1
// Defaults of "r_squared" (see the indicator reference)
let params = HashMap::from([
("period".to_string(), 20.0),
]);
let mut indicator = build_checked("r_squared", ¶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.