Strategy · Pine Script v5 · On the chart

VSA Pro: Trend and Rejection

by MeridianAlgo

VSA Pro: Trend and Rejection is an overlay strategy combining SuperTrend trend filtering with Volume Spread Analysis principles.

View on GitHub

GitHub stars9on the repository
Pine versionv5runs as is
Lines of code94
Settings8inputs
LicenceMIT
Last update4 months ago29 Jun 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

94 lines of Pine Script v5 from examples/VSA_Pro_Trend_and_Rejection.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

VSA_Pro_Trend_and_Rejection.pine
//@version=5
strategy("VSA Pro: Trend and Rejection 🚀", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, currency=currency.TRY, process_orders_on_close=true)

// --- 1. AYARLAR ---
group_trend = "Trend Ayarları (SuperTrend)"
st_period = input.int(10, "ST Periyodu", group=group_trend)
st_multiplier = input.float(3.0, "ST Çarpanı", step=0.1, group=group_trend)

group_volatility = "Hacim & Volatilite (VSA)"
atr_length = input.int(14, "ATR Uzunluğu", group=group_volatility)
min_vol_mult = input.float(1.0, "Min. Hacim Eşiği (Ortalama)", group=group_volatility)
effort_mult = input.float(2.0, "Yüksek Hacim (Görsel Ekleme)", step=0.1, group=group_volatility)
result_mult = input.float(1.5, "Gövde Boyu (Görsel Momentum)", step=0.1, group=group_volatility)

group_labels = "Etiket İsimleri"
txt_start_long = input.string("AL", "Trend Başlangıcı (Long)", group=group_labels)
txt_start_short = input.string("NAKİT", "Trend Bitişi (Sat)", group=group_labels)

// --- 2. HESAPLAMALAR ---

[superTrendVal, superTrendDir] = ta.supertrend(st_multiplier, st_period)

isTrendNewGreen = superTrendDir == -1 and superTrendDir[1] == 1 
isTrendNewRed = superTrendDir == 1 and superTrendDir[1] == -1 

isGreenZone = superTrendDir == -1
isRedZone = superTrendDir == 1

atr = ta.atr(atr_length)
avgVol = ta.sma(volume, 50)
bodySize = math.abs(close - open)
isGreenCandle = close > open
isRedCandle = close < open

relBodyATR = bodySize / atr 
relVol = volume / avgVol
isVolumeValid = volume > (avgVol * min_vol_mult)

// --- 3. MANTIK VE SİNYALLER ---

signal_AL = isTrendNewGreen
signal_SAT = isTrendNewRed

// VSA Fırsatları (Görünürlük için renkler ve mantık optimize edildi)
cond_L1 = isGreenCandle and relBodyATR > result_mult
cond_L2 = isRedCandle and relVol > effort_mult and relBodyATR < 0.8
signal_EKLE_Gorsel = isGreenZone and (not isTrendNewGreen) and isVolumeValid and (cond_L1 or cond_L2)

cond_S1 = isRedCandle and relBodyATR > result_mult
cond_S2 = isGreenCandle and relVol > effort_mult and relBodyATR < 0.8
signal_ZAYIFLIK_Gorsel = isRedZone and (not isTrendNewRed) and isVolumeValid and (cond_S1 or cond_S2)

// --- 4. STRATEJİ EMİRLERİ ---

if signal_AL
    strategy.entry("Long_Giris", strategy.long, comment="AL %100")

if signal_SAT
    strategy.close_all(comment="NAKİTE GEÇ 🔴")

// --- 5. GÖRSELLEŞTİRME ---

lineColor = isGreenZone ? color.new(color.green, 0) : color.new(color.red, 0)
plot(superTrendVal, "Trend Hattı", color = lineColor, linewidth=2)
bgcolor(isGreenZone ? color.new(color.green, 90) : color.new(color.red, 90), title="Trend Bölgeleri")

// 1. ANA İŞLEM ETİKETLERİ (AL - SAT)
if signal_AL
    label.new(bar_index, low, "🟢\n" + txt_start_long, style=label.style_label_up, color=color.green, textcolor=color.white, size=size.normal)

if signal_SAT
    label.new(bar_index, high, "🔴\n" + txt_start_short, style=label.style_label_down, color=color.red, textcolor=color.white, size=size.normal)

// 2. VSA FIRSAT ETİKETLERİ (Görünürlük Artırıldı)
// Ekleme Sinyali: Daha koyu Turkuaz (Teal) ve 'label_center' stili ile daha belirgin
if signal_EKLE_Gorsel
    label.new(bar_index, low * 0.998, "➕", style=label.style_label_center, color=color.new(#00f2ff, 0), textcolor=color.black, size=size.small, tooltip="Güçlü Alım/Ekleme")

// Zayıflık Sinyali: Daha parlak Turuncu/Sarı ve 'label_center' stili
if signal_ZAYIFLIK_Gorsel
    label.new(bar_index, high * 1.002, "⚠️", style=label.style_label_center, color=color.new(#ffea00, 0), textcolor=color.black, size=size.small, tooltip="Trend Zayıf / Dikkat")

// --- TABLO (LEGEND) ---
var table legend = table.new(position.bottom_right, 2, 2, bgcolor=color.new(color.black, 60), frame_color=color.gray, border_width=1, force_overlay=true)

if barstate.islast
    table.cell(legend, 0, 0, "STRATEJİ DURUMU", text_color=color.yellow)
    table.merge_cells(legend, 0, 0, 1, 0)
    
    string statusText = isGreenZone ? "ALIMDA (Yükseliş)" : "NAKİTTE (Düşüş)"
    color statusColor = isGreenZone ? color.green : color.red
    
    table.cell(legend, 0, 1, statusText, text_color=statusColor, text_size=size.normal)
    table.merge_cells(legend, 0, 1, 1, 1)

Overview

VSA Pro: Trend and Rejection calculates SuperTrend direction to enter long positions when a new bullish trend starts and exits all positions when the trend turns bearish. VSA metrics, including relative volume and ATR body ratios, identify visual addition or weakness signals during active trends. Key settings allow adjusting SuperTrend parameters, ATR length, and volume thresholds. Note that the strategy relies solely on trend reversals and lacks an explicit stop loss.

Details

Published by

MeridianAlgo on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Trend, Volume, Volatility & bands

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Topics

code-converterconverterjavascriptpinescripttranspilercode-reviewmeridianalgocode-conversionpinescript-algorithms

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ST Periyoduint10st_period
ST Çarpanıfloat3.0st_multiplier
ATR Uzunluğuint14atr_length
Min. Hacim Eşiği (Ortalama)float1.0min_vol_mult
Yüksek Hacim (Görsel Ekleme)float2.0effort_mult
Gövde Boyu (Görsel Momentum)float1.5result_mult
Trend Başlangıcı (Long)stringALtxt_start_long
Trend Bitişi (Sat)stringNAKİTtxt_start_short
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

106 stars

This Pine v4 strategy draws on the price chart and filters breakouts with a fixed Supertrend, ATR length, volume moving-average markup, and moving-average alignment, plus short and long high-low periods. Trade direction defaults to long and can include shorts.

Strategy v4 BreakoutTrend
Updated 2 years ago · GPL-3.0 GitHub repository of Breakout Trend Trading - V1

This strategy enters long or short when eight conditions align over the last two bars. It requires EMA 10 and EMA 55 alignment on the one-hour, four-hour and daily charts, a positive ADX slope, matching monitor direction, and price relative to a 400-bar point

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ruckard ABCBitcoin TradingLatino B002
8 stars

This overlay strategy combines three distinct SuperTrend levels with multiple moving averages and volume profile analytics on the main price chart. It calculates trend directions using three configurable ATR periods and multipliers alongside SMA, EMA, and HMA

Strategy v5 TrendVolatility & bands
Updated 4 years ago · None stated GitHub repository of ATR 3Lvls VP Strategy
330 stars

This strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities. It enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specifi

Strategy v5 Mean reversionVolatility & bands
Updated 2 months ago · None stated GitHub repository of Bollinger bands + Aroon [Alorse]
257 stars

This overlay strategy targets one-minute ES futures and plots volume-weighted moving-average bands from the open, scaled by a standard-deviation multiple, plus a slower band from ten-minute opens. A higher-timeframe exponential moving average can filter trades

Strategy v6 Moving averagesVolatility & bands
Updated 6 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint

STRG-BBForce

by harryguiacorn
219 stars

STRG-BBForce is a Bollinger Bands trend-following strategy. It calculates standard Bollinger Bands and tracks directional alignment across the upper, lower, and basis lines. When all three lines slope upward, it opens a long position and closes short positions

Strategy v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of STRG-BBForce

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers