OPEN-SOURCE SCRIPT

Adaptive Trend Intelligence + SMC + RVOL + ML - FloAlgo

2 167
This indicator combines an Adaptive SuperTrend with Smart Money Concepts (SMC) market structure, Relative Volume (RVOL) filtering, and an online Machine Learning model to produce high-confidence trend-following signals.

How It Works

Adaptive SuperTrend — A SuperTrend band whose ATR multiplier scales automatically based on the short/long volatility ratio. In quiet markets the band tightens; in expansions it widens. An optional noise filter requires price to hold on the new side for N bars before a flip is accepted, eliminating whipsaws.

SMC Market Structure Engine — Uses a Stochastic Momentum Oscillator to detect overbought/oversold pivots and build an alternating High/Low swing chain. From those swings it tracks Dow-Theory labels (HH, HL, LH, LL), draws a zigzag, plots S/R zones, and detects BOS (Break of Structure) when price closes beyond the previous major swing confirming trend continuation, and CHoCH (Change of Character) when price closes beyond the prior opposing major swing signaling a trend flip. Both events require an established trend direction and fire only against the correct structural level, preventing false signals on internal corrections.

RVOL Filter — Computes directional buy/sell volume from candle structure and ranks it against a rolling percentile. Signals are suppressed unless the directional volume percentile clears a configurable threshold, keeping entries to high-participation moves only.

Online ML Model — A logistic regression model with L2 regularisation trained incrementally on every confirmed SuperTrend flip. It learns 17 features per signal including candle shape, volume, momentum, ATR slope, RSI, Bollinger position, RVOL, and SMC bias, then resolves each trade when the next flip occurs. Probability is displayed in the info table and can gate signals via a minimum confidence threshold.

Visual Elements

  • SuperTrend line with bull/bear fill
  • ▲ / ▼ signal arrows and labels
  • BOS / CHoCH labels at structure breaks
  • HH / HL / LH / LL Dow labels at each pivot
  • Zigzag lines connecting momentum pivots
  • S/R zone boxes, colour-coded and fading on break
  • Info table showing Signal, Trend, ML Confidence, RVOL, Momentum, Volatility, Quality, MS Bias, and last Structure event


Key Settings

  • ATR Length — lookback for ATR calculation
  • ATR Multiplier — base band width
  • Adaptive Multiplier — auto-scales multiplier with volatility ratio
  • Noise Filter (bars) — bars price must hold before flip is confirmed
  • RVOL Lookback — rolling window for volume percentile ranking
  • RVOL Min Percentile % — minimum directional volume percentile to allow a signal
  • Min ML Probability % — minimum ML model confidence to allow a signal
  • Stochastic Length — sensitivity of the momentum pivot oscillator
  • Overbought / Oversold — stochastic zone thresholds for pivot detection
  • Filter Signals by MS — gate signals to align with SMC trend direction
  • Max S/R Zones per Side — maximum supply/demand boxes kept on chart

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.