trend_relationship
Adaptive trend relationship between two configurable smoothers
trend_relationship
examples/site_showcase.rs// Adaptive trend relationship between two configurable smoothers (build via build_typed with fast_kind/slow_kind params: ema|sma|rma|alma|jma)
// Defaults of "trend_relationship" (see the indicator reference)
let params = HashMap::from([
("fast_len".to_string(), 9.0),
("slow_len".to_string(), 21.0),
]);
let mut indicator = build_checked("trend_relationship", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}