kestrel-chartkitv0.33.0

← All examples

accumulation_phase

Accumulation Phase: accumulation

accumulation_phase

examples/site_showcase.rs
// Accumulation Phase: accumulation (bottom) and distribution (top) as process states from five components 0..2 each (trend loss, range formation, volatility compression, liquidity sweeps/springs, early structure); value = accumulation score 0..10, secondary = distribution score; extra: components per side, accum/dist_bars, accum/dist_state (0 none .. 5 breakout/breakdown ready), efficiency, bbw_ratio, atr_ratio, range_atr; alerts bull_accumulation_developing/_mature, bull_breakout_ready, bear_distribution_developing/_mature, bear_breakdown_ready
// Defaults of "accumulation_phase" (see the indicator reference)
let params = HashMap::from([
    ("atr_compress".to_string(), 0.8),
    ("atr_len".to_string(), 14.0),
    ("bbw_compress".to_string(), 0.7),
    ("er_range".to_string(), 0.3),
    ("lookback".to_string(), 20.0),
    ("min_phase_bars".to_string(), 10.0),
    ("pivot_left".to_string(), 3.0),
    ("pivot_right".to_string(), 3.0),
]);
let mut indicator = build_checked("accumulation_phase", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Accumulation Phase: accumulation (bottom) and distribution (top) as process states from five components 0..2 each (trend loss, range formation, volatility compression, liquidity sweeps/springs, early structure); value = accumulation score 0..10, secondary = distribution score; extra: components per side, accum/dist_bars, accum/dist_state (0 none .. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 1 alerts in view, the latest as markers.Accumulation Phase: accumulation (bottom) and distribution (top) as process states from five components 0..2 each (trend loss, range formation, volatility compression, liquidity sweeps/springs, early structure); value = accumulation score 0..10, secondary = distribution score; extra: components per side, accum/dist_bars, accum/dist_state (0 none .. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 1 alerts in view, the latest as markers.
  • Composite read-outs, part 2
  • unit: Unitless