kestrel-chartkitv0.33.0

← All examples

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", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Adaptive trend relationship between two configurable smoothers (build via build_typed with fast_kind/slow_kind params: ema|sma|rma|alma|jma). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.Adaptive trend relationship between two configurable smoothers (build via build_typed with fast_kind/slow_kind params: ema|sma|rma|alma|jma). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.
  • Moving averages, bands and trend lines
  • unit: Unitless