kestrel-chartkitv0.49.0

← All examples

correlation_trend

Ehlers' Correlation Trend Indicator: the Pearson correlation of the last length closes with a rising stra…

correlation_trend

examples/site_showcase.rs
// Ehlers' Correlation Trend Indicator: the Pearson correlation of the last `length` closes with a rising straight line; a window of equal closes reads 0
// Defaults of "correlation_trend" (see the indicator reference)
let params = HashMap::from([
    ("length".to_string(), 20.0),
]);
let mut indicator = build_checked("correlation_trend", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Ehlers' Correlation Trend Indicator: the Pearson correlation of the last `length` closes with a rising straight line; a window of equal closes reads 0. 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.Ehlers' Correlation Trend Indicator: the Pearson correlation of the last `length` closes with a rising straight line; a window of equal closes reads 0. 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.
  • Oscillators
  • unit: Unitless