kestrel-chartkitv0.33.0

← All examples

sweep_reversal_score

Sweep Reversal Score

sweep_reversal_score

examples/site_showcase.rs
// Sweep Reversal Score (chart-timeframe configuration, higher-timeframe gates off): liquidity sweep of the last swing_len bars' extreme with a close back inside, ATR above atr_low_factor x its SMA, quality 0..2 (long: RSI > 50, no lower low; short mirrored: RSI < 50, no higher high) against min_quality_long/short (both 2), cooldown; value 1 long / -1 short / 0; extra: long_quality, short_quality, rsi, atr, atr_base, swing_low, swing_high, entry/stop/take on signal bars; alerts bull/bear_sweep_reversal
// Defaults of "sweep_reversal_score" (see the indicator reference)
let params = HashMap::from([
    ("atr_base_len".to_string(), 50.0),
    ("atr_len".to_string(), 14.0),
    ("atr_low_factor".to_string(), 0.6),
    ("cooldown".to_string(), 5.0),
    ("min_quality_long".to_string(), 2.0),
    ("min_quality_short".to_string(), 2.0),
    ("pivot_len".to_string(), 5.0),
    ("rsi_len".to_string(), 14.0),
    ("swing_len".to_string(), 10.0),
]);
let mut indicator = build_checked("sweep_reversal_score", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Sweep Reversal Score (chart-timeframe configuration, higher-timeframe gates off): liquidity sweep of the last swing_len bars' extreme with a close back inside, ATR above atr_low_factor x its SMA, quality 0..2 (long: RSI > 50, no lower low; short mirrored: RSI < 50, no higher high) against min_quality_long/short (both 2), cooldown; value 1 long / -1 short / 0; extra: long_quality, short_quality, rs. 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.Sweep Reversal Score (chart-timeframe configuration, higher-timeframe gates off): liquidity sweep of the last swing_len bars' extreme with a close back inside, ATR above atr_low_factor x its SMA, quality 0..2 (long: RSI > 50, no lower low; short mirrored: RSI < 50, no higher high) against min_quality_long/short (both 2), cooldown; value 1 long / -1 short / 0; extra: long_quality, short_quality, rs. 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