Skip to main content

Volume SuperTrend AI (VSAI): A Volume-Weighted AI Trend Indicator

How Sahi's Volume SuperTrend AI blends a volume-weighted SuperTrend with a KNN layer, and how to trade its line, dots and triangles.

Revati Krishna
Published: 2 Jul 2026, 05:30 PM IST (3 weeks ago)
Last Updated: 3 Jul 2026, 01:29 PM IST (3 weeks ago)
6 min read

Quick Answer

Volume SuperTrend AI (VSAI) is a trend-following indicator that combines a volume-weighted SuperTrend with a K-Nearest Neighbors (KNN) machine-learning layer. Its single line colours lime green for bullish, red for bearish and blue for neutral, acting as dynamic support or resistance. Dots are early trend-start alerts; triangles are the confirmed crossover signals to trade (they need both a SuperTrend flip and KNN agreement). It is free on SAHI, with no subscription required.

Overview

Volume SuperTrend AI is a trend-following indicator that combines a volume-weighted SuperTrend with a K-Nearest Neighbors (KNN) machine-learning layer. The SuperTrend bands are built using a volume-weighted moving average of price rather than raw price, so a burst of high volume shifts the bands more than quiet candles do. The KNN layer then looks at the recent history of how price behaved relative to the trend and classifies the current bar as bullish, bearish, or neutral — colouring the line accordingly.

On the SAHI chart it draws one continuous trend line that changes colour (lime green for bullish, red for bearish, blue for neutral), a gradient cloud that fills the space between that line and a short-term price reference, small dots that mark the first bar of a new trend direction, and triangles that mark confirmed crossover signals. Every element stays anchored to price, so the indicator lives directly on the price chart without a separate panel.

How to Read the Indicator

The SuperTrend Line and Its Colour

The main plot is a single line that follows price from above or below, acting as a dynamic support/resistance level. Its colour tells you the AI's current directional verdict:

  • Lime green — KNN classifies this bar as bullish; price is above the smoothed trend and the algorithm's nearest-neighbor vote is long.
  • Red — KNN classifies this bar as bearish; price is below the smoothed trend and the vote is short.
  • Blue — Neutral; the KNN vote is inconclusive (neither clearly bullish nor bearish).

The line flips from below price to above price (or vice versa) at trend reversals — this is the same mechanic as a standard SuperTrend, except the band midpoint is volume-weighted. When the line is below price and green, it is acting as support. When it is above price and red, it is acting as resistance.

Dots — Trend-Start Markers

Small circles appear on the line at the exact bar where the colour first changes to green or red (coming from a different colour). A green dot marks the first bar of a new bullish phase; a red dot marks the first bar of a new bearish phase.

Dots are an early alert, not a confirmed entry. They fire one bar before a triangle because they only require the colour to have just changed — the full directional crossover does not have to have completed yet. Use dots to get on alert; wait for a triangle or bar close before acting.

Triangles — Confirmed Crossover Signals

Triangles are the indicator's strongest, most explicit signals. They appear only when a genuine SuperTrend direction flip occurs AND the KNN vote agrees:

  • Green upward triangle — the SuperTrend has just crossed from bearish (upper band) to bullish (lower band) and the KNN vote is bullish (label = 1). This is a confirmed bullish crossover.
  • Red downward triangle — the SuperTrend has just crossed from bullish to bearish and the KNN vote is bearish (label = 0). This is a confirmed bearish crossover.

Triangles are relatively rare. They require both the mechanical flip and the AI agreement simultaneously. A triangle without a colour-matching bar close should still be treated as tentative — always confirm on bar close before entering.

The Cloud

The shaded cloud fills the space between the smoothed SuperTrend line and a short-term EMA of the midpoint ((open + close) / 2). The cloud colour mirrors the line's bullish/bearish/neutral state:

  • Green cloud — bullish trend in force; the thicker (denser) inner band is closest to the line, the lighter outer fringes spread toward the price reference.
  • Red cloud — bearish trend in force.

The cloud's depth gives a visual sense of how stretched price is from the trend line. A widening cloud means price is accelerating away from the line; a contracting cloud means price and the trend line are converging — a potential reversal or pause setup. When price trades back into the cloud itself, treat it as a zone of interest rather than a trigger.

Example Scenarios

Scenario 1 — Green triangle + green cloud, buy a CE (bullish)

Nifty has been drifting sideways around 24,820 for most of the morning. On the 15-minute chart, the SuperTrend line has been red and sitting above price. At 11:15, a green upward triangle appears on the line as it flips below the current candle and the cloud turns green. The bar closes at 24,855 with the line now at 24,810.

  • What you do: buy 1 lot of Nifty 24,900 CE at a premium of about ₹105.
  • Stop loss: if a candle closes below the SuperTrend line (currently near 24,810), the flip has failed — exit. The premium would be around ₹68 there.
  • Target: the prior swing high near 24,980; CE premium would be roughly ₹155 there.
  • Why it works: the triangle confirms both a mechanical crossover and KNN agreement, giving two independent confirmations before the entry.

Scenario 2 — Red triangle + widening red cloud, buy a PE (bearish)

Nifty rallied to 25,080 in the first hour. On the 15-minute chart, the line has been green below price, but at 10:30 a red downward triangle appears as the line flips above price and the cloud turns red and starts widening. The bar closes at 25,040 with the line now at 25,065.

  • What you do: buy 1 lot of Nifty 25,000 PE at a premium of about ₹90.
  • Stop loss: if a candle closes above the SuperTrend line (currently near 25,065), the bearish flip has failed — exit. The premium would be around ₹58 there.
  • Target: the day's prior base near 24,950; PE premium would be roughly ₹140 there.
  • Why it works: the widening red cloud shows momentum is already pushing price away from trend in the bearish direction; the triangle confirms the AI agrees.

Scenario 3 — What to avoid

  • Do not trade a dot without waiting for bar close. Dots fire intra-bar the moment the colour changes. Colour can revert before the bar closes, especially on 1-minute charts. Always wait for the candle to close before treating a dot as a signal.
  • Do not enter on a colour change alone with no triangle. A persistent green or red line without a triangle just means the existing trend is continuing — there is no new crossover. Entering mid-trend without a clearly defined entry level gives you no edge and a vague stop.
  • Avoid triangles in a choppy, sideways market. When price keeps whipsawing around the line and the cloud is thin and flat, the KNN algorithm cycles through bullish and bearish labels rapidly. Multiple triangles in quick succession with tiny body candles is a sign the trend is not committed — step aside until the line holds a clear side for at least 3–4 candles.
  • Do not ignore the cloud colour when it disagrees with the line. In rare cases during fast gaps, the cloud reference EMA may lag behind. If the cloud colour and line colour mismatch for more than one bar, wait for them to agree before entering.

Settings Panel Guide

AI Settings

  • Neighbors (k): the number of nearest neighbors the KNN algorithm votes from. Default is 3. Increase (e.g. to 5–7) for a more stable, averaged vote that changes less often; decrease to 1–2 for a more responsive but noisier classification. For Nifty intraday on 5- or 15-minute charts, 3 is a reasonable starting point.
  • Data (n): how many recent SuperTrend data points the algorithm looks back through when finding neighbors. Default is 10. Increase (up to 20–30) for a broader historical context; decrease to focus on the last few bars only. The script internally enforces n greater than or equal to k, so setting Data lower than Neighbors has no effect.

AI Trend

  • Price Trend (KNN_PriceLen): length of the weighted moving average applied to closing price before the KNN comparison. Default is 20. Higher values smooth the price reference so the AI reacts to sustained moves rather than single spikes. Lower values make it react faster but increase whipsaws.
  • Prediction Trend (KNN_STLen): length of the WMA applied to the SuperTrend line inside the KNN comparison. Default is 100. This is the "long memory" of the AI — a high value means the algorithm anchors to the broad trend direction; lowering it makes the AI more willing to flip. Leave at 100 for trend-following; lower to 40–60 only if you want earlier signals on faster timeframes.
  • AI Trend Signals: toggle that shows or hides all dots and triangles. Default is on. Turn off if you only want the line and cloud without signal markers.
  • Bullish/Bearish signal colours (two swatches): colour of the dots and triangles for bullish and bearish signals respectively. Cosmetic only.

Super Trend Settings

  • Length: ATR lookback period for the SuperTrend bands. Default is 10. Shorter (e.g. 7) gives tighter bands that flip more often; longer (e.g. 14–20) gives wider bands and fewer but more significant flips. On BankNifty intraday, 10 is standard; go higher on Bank Nifty daily charts.
  • Factor (ATR multiplier): how wide the bands sit from the volume-weighted midpoint. Default is 3.0. Increase to 3.5–4.0 to reduce noise and false flips on volatile days; decrease to 2.0–2.5 for tighter signals in trending, low-volatility sessions.
  • Moving Average Source (maSrc): which averaging method is used to calculate the volume-weighted band midpoint. Default is WMA. Options: SMA, EMA, WMA, RMA, VWMA. WMA gives more weight to recent price×volume and is the most responsive; VWMA double-weights by volume. SMA is the flattest and least reactive. For intraday Nifty, WMA or EMA are the most useful choices.

Super Trend Colouring

  • Bullish Color: line colour when KNN votes bullish. Default is lime. Cosmetic only.
  • Bearish Color: line colour when KNN votes bearish. Default is red. Cosmetic only.
  • Neutral Color: line colour when KNN vote is inconclusive. Default is blue. Cosmetic only.

Cloud Fill

  • Show Cloud Fill: master toggle for the cloud. Default is on. Turn off for a clean single-line view if the cloud feels cluttered on your timeframe.
  • Bull Cloud / Bear Cloud (two swatches): fill colours for the bullish and bearish cloud states. Cosmetic only.
  • Cloud Transparency: how opaque the cloud fill is. Default is 78 (0 = fully opaque, 95 = nearly invisible). Lower the number (e.g. to 65) to make the cloud more prominent; raise it (e.g. to 88) to keep it subtle. Works well at 78 for most intraday setups.
  • Cloud Reference Length: the EMA length used to compute the cloud's outer boundary (the price-midpoint reference). Default is 10. Higher values (15–20) create a wider, more stable cloud; lower values (5–7) make the cloud hug price more closely and fluctuate more.
  • Cloud Line Smoothing: extra smoothing on the SuperTrend line before the cloud is built. Default is 2. Increase to 3–5 for a visually cleaner cloud on noisy charts; keep at 1–2 for the most accurate representation of the actual trend line.
  • Cloud Richness: how many layered fill bands build the gradient effect. Default is 3 (maximum). Set to 2 for a simpler two-band cloud, or 1 for a flat single fill. 3 gives the fullest gradient look; lower values slightly reduce rendering weight on slower devices.

Frequently Asked Questions (FAQs)

All topics