Indicator · Pine Script v6 · On the chart

Capital41 Fusion Scalp

by damianpitt· code credited to Capital41 | MIT License

Capital41 Fusion Scalp is an overlay indicator that identifies high-confluence setups by combining four core conditions: EMA trend direction, RSI momentum, Williams %R levels, and ATR with volume expansion.

View on GitHub

GitHub stars6on the repository
Pine versionv6current
Lines of code167
Settings23inputs
LicenceMIT
Last update8 weeks ago31 Aug 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 indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

167 lines of Pine Script v6 from Capital41_Fusion Strategy/Capital41_Fusion_Scalp_v3.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Capital41_Fusion_Scalp_v3.pine
// Copyright (c) 2026 Capital41 | MIT License
// CAPITAL41 FUSION SCALP v3 (RSI + W%R + EMA + ATR/VOL)

// What it does:
// - High-confluence fusion signal for 30m scalping.
// - Combines four conditions: RSI, Williams %R, EMA trend, and ATR/Volume expansion.
// - Signals only when ALL conditions align.
// - Companion oscillator script available for a separate pane.
//
// v2 changes:
// - FIXED: Added barstate.isconfirmed to longSignal/shortSignal so signals are
//   non-repainting (was missing, causing signals to appear/disappear intra-bar).
//
// Condition boxes (bottom-left):
// - EMA: EMA trend filter (EMA+ above, EMA- below).
// - RSI: RSI condition (RSI+ long, RSI- short).
// - WR: Williams %R condition (WR+ long, WR- short).
// - VOL: ATR + Volume expansion filter (VOL+ true).
// - SIG: Final confluence signal (SIG L or SIG S).
//
// TradingView setup:
// 1) Open TradingView -> Pine Editor.
// 2) Paste this script, Save, and Add to chart.
// 3) Use 30m timeframe on BTC or US stocks.
// 4) If signals are too few, loosen thresholds via inputs.
//
// Usage guide (30m):
// - Longs only when price is above EMA, RSI/W%R are oversold and turning up,
//   and volatility + volume are expanding.
// - Shorts only when price is below EMA, RSI/W%R are overbought and turning down,
//   and volatility + volume are expanding.
// - Use the Fusion Oscillator companion script for a separate panel like RSI.



//@version=6
indicator("Capital41 Fusion Scalp v3", overlay = true, max_labels_count = 50)


// Inputs
emaLen      = input.int(50, "EMA length", minval = 5)
showEMA     = input.bool(true, "Show EMA")

rsiLen      = input.int(14, "RSI length", minval = 2)
rsiOB       = input.int(65, "RSI overbought", minval = 50, maxval = 90)
rsiOS       = input.int(35, "RSI oversold", minval = 10, maxval = 50)

wrLen       = input.int(14, "Williams %R length", minval = 2)
wrOB        = input.float(-20.0, "W%R overbought")
wrOS        = input.float(-80.0, "W%R oversold")

requireTurn = input.bool(true, "Require RSI/W%R turn")

atrLen      = input.int(14, "ATR length", minval = 1)
atrAvgLen   = input.int(20, "ATR avg length", minval = 5)
atrExpMult  = input.float(1.1, "ATR expansion multiplier", minval = 1.0, maxval = 3.0)

volLen      = input.int(50, "Volume SMA length", minval = 5)
volMult     = input.float(1.0, "Volume multiplier", minval = 0.5, maxval = 3.0)

showSignals = input.bool(true, "Show signals")
showBadge   = input.bool(true, "Show status badge")
badgeSize   = input.string("Normal", "Badge size", options = ["Small", "Normal", "Large", "Huge"])
badgeBorder = input.int(2, "Badge border width", minval = 0, maxval = 4)

showTrendBg  = input.bool(true, "Show trend background")
showExpBg    = input.bool(false, "Show expansion background")
showSignalBg = input.bool(true, "Show signal background")
showBarColor = input.bool(false, "Color bars by trend")
colorEMAByTrend = input.bool(true, "Color EMA by trend")

colorBull    = color.new(color.lime, 0)
colorBear    = color.new(color.red, 0)
colorNeutral = color.new(color.gray, 80)


// Trend filter
ema = ta.ema(close, emaLen)
trendLong  = close > ema
trendShort = close < ema
emaColor = colorEMAByTrend ? (trendLong ? colorBull : trendShort ? colorBear : color.new(color.gray, 0)) : color.new(color.gray, 0)
plot(showEMA ? ema : na, title = "EMA", color = emaColor, linewidth = 2)

// === RSI ===
rsi = ta.rsi(close, rsiLen)

rsiLongTurn  = rsi[1] < rsiOS and rsi > rsi[1]
rsiShortTurn = rsi[1] > rsiOB and rsi < rsi[1]

rsiLong  = requireTurn ? rsiLongTurn  : rsi < rsiOS
rsiShort = requireTurn ? rsiShortTurn : rsi > rsiOB


// Williams %R
wr_manual(_high, _low, _close, _len) =>
    hh = ta.highest(_high, _len)
    ll = ta.lowest(_low, _len)
    rng = hh - ll
    rng == 0 ? -50.0 : (hh - _close) / rng * -100

wr = wr_manual(high, low, close, wrLen)

wrLongTurn  = wr[1] < wrOS and wr > wr[1]
wrShortTurn = wr[1] > wrOB and wr < wr[1]

wrLong  = requireTurn ? wrLongTurn  : wr < wrOS
wrShort = requireTurn ? wrShortTurn : wr > wrOB


// ATR + Volume expansion
atr = ta.atr(atrLen)
atrAvg = ta.sma(atr, atrAvgLen)
atrExp = atrAvg > 0 and atr > atrAvg * atrExpMult

volSma = ta.sma(volume, volLen)
volOk  = volSma > 0 and volume > volSma * volMult

expansionOK = atrExp and volOk


// Fusion signals (v2: barstate.isconfirmed added for non-repainting)
longSignal  = showSignals and barstate.isconfirmed and trendLong and rsiLong and wrLong and expansionOK
shortSignal = showSignals and barstate.isconfirmed and trendShort and rsiShort and wrShort and expansionOK

plotshape(longSignal, title = "Fusion Long", style = shape.triangleup,
          location = location.belowbar, color = colorBull, size = size.small, text = "L")

plotshape(shortSignal, title = "Fusion Short", style = shape.triangledown,
          location = location.abovebar, color = colorBear, size = size.small, text = "S")

alertcondition(longSignal, title = "Fusion Long",
               message = "Fusion Scalp: long signal - RSI + W%R + EMA + ATR/Vol aligned on {{ticker}} ({{interval}})")

alertcondition(shortSignal, title = "Fusion Short",
               message = "Fusion Scalp: short signal - RSI + W%R + EMA + ATR/Vol aligned on {{ticker}} ({{interval}})")


// Visual context
color bg = na
bg := showTrendBg ? (trendLong ? color.new(colorBull, 92) : trendShort ? color.new(colorBear, 92) : na) : na
bg := showExpBg and expansionOK ? color.new(color.orange, 92) : bg
bg := showSignalBg ? (longSignal ? color.new(colorBull, 88) : shortSignal ? color.new(colorBear, 88) : bg) : bg
bgcolor(bg)

barcolor(showBarColor ? (trendLong ? color.new(colorBull, 60) : trendShort ? color.new(colorBear, 60) : na) : na)


// Status badge (single row)
var table status = table.new(position.top_left, 5, 1, border_width = badgeBorder)
badgeTextSize = badgeSize == "Huge" ? size.huge : badgeSize == "Large" ? size.large : badgeSize == "Normal" ? size.normal : size.small

if barstate.islast
    if showBadge
        trText  = trendLong ? " EMA+ " : trendShort ? " EMA- " : " EMA0 "
        rsiText = rsiLong ? " RSI+ " : rsiShort ? " RSI- " : " RSI0 "
        wrText  = wrLong ? " WR+ " : wrShort ? " WR- " : " WR0 "
        exText  = expansionOK ? " VOL+ " : " VOL0 "
        sigText = longSignal ? " SIG L " : shortSignal ? " SIG S " : " SIG - "

        table.cell(status, 0, 0, trText,  bgcolor = trendLong ? color.new(colorBull, 70) : trendShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = badgeTextSize)
        table.cell(status, 1, 0, rsiText, bgcolor = rsiLong ? color.new(colorBull, 70) : rsiShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = badgeTextSize)
        table.cell(status, 2, 0, wrText,  bgcolor = wrLong ? color.new(colorBull, 70) : wrShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = badgeTextSize)
        table.cell(status, 3, 0, exText,  bgcolor = expansionOK ? color.new(color.orange, 70) : colorNeutral, text_color = color.white, text_size = badgeTextSize)
        table.cell(status, 4, 0, sigText, bgcolor = longSignal ? color.new(colorBull, 60) : shortSignal ? color.new(colorBear, 60) : colorNeutral, text_color = color.white, text_size = badgeTextSize)
    else
        for i = 0 to 4
            table.cell(status, i, 0, "", bgcolor = color.new(color.black, 100), text_color = color.new(color.black, 100))

Overview

Bullish and bearish signals are plotted on the chart only when all criteria align simultaneously, such as price trading above the EMA while momentum oscillators turn up from oversold levels during expanding volume. The script includes an on-chart status badge dashboard and background trend fills.

Details

Published by

damianpitt on GitHub

Code credit

Capital41 | MIT License, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Oscillators & momentum, Volatility & bands, Volume

Markets

Crypto, Stocks

Timeframes

M1-M5, M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

cryptoindicatorsmarket-structureorder-blockspinescriptsmart-moneytechnical-analysistechnical-analysis-indicatorstradingtradingview

Settings

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

SettingTypeDefaultVariable
EMA lengthint50emaLen
Show EMAbooltrueshowEMA
RSI lengthint14rsiLen
RSI overboughtint65rsiOB
RSI oversoldint35rsiOS
Williams %R lengthint14wrLen
W%R overboughtfloat-20.0wrOB
W%R oversoldfloat-80.0wrOS
Require RSI/W%R turnbooltruerequireTurn
ATR lengthint14atrLen
ATR avg lengthint20atrAvgLen
ATR expansion multiplierfloat1.1atrExpMult
Show all 23 settings
SettingTypeDefaultVariable
Volume SMA lengthint50volLen
Volume multiplierfloat1.0volMult
Show signalsbooltrueshowSignals
Show status badgebooltrueshowBadge
Badge sizestringNormalbadgeSize
Badge border widthint2badgeBorder
Show trend backgroundbooltrueshowTrendBg
Show expansion backgroundboolfalseshowExpBg
Show signal backgroundbooltrueshowSignalBg
Color bars by trendboolfalseshowBarColor
Color EMA by trendbooltruecolorEMAByTrend
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

The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup

Aroon-based Strategy

by capissimo
114 stars

This indicator overlay generates buy and sell signals based on Aroon extreme levels combined with optional volume or volatility filters. It calculates Aroon Up and Aroon Down lines using localized high and low lookbacks, generating trade entries when Aroon rea

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Aroon-based Strategy
92 stars

This indicator plots a volume-weighted average price of the typical price on the chart and colors that line by ADX strength. It draws a standard-deviation envelope around VWAP and tints the fill green when plus DI leads and red when minus DI leads. Triangle ma

Indicator v5 TrendOscillators & momentum
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev VWAP x ADX Explosion

Vein Exhaustion is a price-chart indicator that scores how stretched a directional move is before structure confirms a turn. It builds separate bull and bear scores from consecutive directional bars, EMA distance in ATR units, RSI and MFI extremes, volume-base

Indicator v6 TrendOscillators & momentum
Updated yesterday · MIT GitHub repository of Vein: Exhaustion [WavesUnchained]
7 stars

The MACD RSI EMA Aggressive indicator generates momentum and trend-following signals on the price chart. It combines a MACD crossover or crossunder with an RSI threshold filter, price location relative to an Exponential Moving Average, volume expansion above a

Indicator v5 TrendOscillators & momentum
Updated 3 months ago · None stated GitHub repository of MACD RSI EMA Aggressive + ATR SLTP

RitstaR-Algo

by ritstar
3 stars

This overlay indicator scores each confirmed bar from zero to six using fast, slow, and trend EMAs, higher-timeframe bias, RSI, MACD, ATR, and volume. It plots buy and sell labels when the score meets the minimum entry threshold and exit labels when the opposi

Indicator v5 TrendOscillators & momentum
Updated 8 months ago · None stated GitHub repository of RitstaR-Algo

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers