Indicator · Pine Script v6 · Own pane

Capital41 Fusion Oscillator v3

by damianpitt· code credited to Capital41 | MIT License

Capital41 Fusion Oscillator v3 measures multi-condition market confluence in a separate pane with a smoothed composite score ranging from 0 to 100.

View on GitHub

GitHub stars6on the repository
Pine versionv6current
Lines of code132
Settings16inputs
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

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

Capital41_Fusion_Oscillator_v3.pine
// Copyright (c) 2026 Capital41 | MIT License
// CAPITAL41 FUSION OSCILLATOR v3 (Companion)

// What it does:
// - Plots a 0–100 Fusion Oscillator based on the same four conditions used in
//   Capital41 Fusion Scalp (EMA trend, RSI, W%R, ATR/Volume expansion).
// - Designed as a separate panel (like RSI) for quick confluence reading.
//
// v3 changes:
// - ADDED: Alert conditions for zone and midline crosses, matching the C41
//          Oscillator companion. Gated by barstate.isconfirmed.
//
// 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) Keep inputs synced with Capital41 Fusion Scalp.
//
// Usage guide (30m):
// - 75+ = bullish confluence, 25- = bearish confluence.
// - Use with Fusion Scalp signals for timing and confirmation.



//@version=6
indicator("Capital41 Fusion Oscillator v3", overlay = false)


// Inputs (sync with Fusion Scalp)
emaLen      = input.int(50, "EMA length", minval = 5)

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)

oscSmooth   = input.int(3, "Oscillator smoothing", minval = 1, maxval = 20)
showZones   = input.bool(true, "Show 25/50/75 zones")
showBg      = input.bool(true, "Background highlight")

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

// === Trend filter ===
ema = ta.ema(close, emaLen)
trendLong  = close > ema
trendShort = close < ema

// === 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 Oscillator (0–100)
expLong    = expansionOK and trendLong  ? 1 : 0
expShort   = expansionOK and trendShort ? 1 : 0
scoreLong  = (trendLong ? 1 : 0) + (rsiLong ? 1 : 0) + (wrLong ? 1 : 0) + expLong
scoreShort = (trendShort ? 1 : 0) + (rsiShort ? 1 : 0) + (wrShort ? 1 : 0) + expShort

fusionRaw = scoreLong - scoreShort
fusion    = (fusionRaw + 4) * 12.5
fusionSm  = ta.sma(fusion, oscSmooth)

oscColor = fusionRaw > 0 ? colorBull : fusionRaw < 0 ? colorBear : color.new(color.gray, 0)
plot(fusionSm, title = "Fusion Oscillator", color = oscColor, linewidth = 2)

plot(showZones ? 75 : na, title = "Upper", color = color.new(color.gray, 70))
plot(showZones ? 50 : na, title = "Mid",   color = color.new(color.gray, 80))
plot(showZones ? 25 : na, title = "Lower", color = color.new(color.gray, 70))

bgcolor(showBg ? (fusionSm >= 75 ? color.new(colorBull, 90) : fusionSm <= 25 ? color.new(colorBear, 90) : na) : na)


// Alerts (crosses hoisted so ta.* runs every bar, then confirmed on bar close)
bullZoneCross = ta.crossover(fusionSm, 75)
bearZoneCross = ta.crossunder(fusionSm, 25)
midCrossUp    = ta.crossover(fusionSm, 50)
midCrossDown  = ta.crossunder(fusionSm, 50)

alertcondition(bullZoneCross and barstate.isconfirmed, title = "Fusion Osc Bull Zone",
               message = "Fusion Oscillator: crossed above upper zone on {{ticker}} ({{interval}})")

alertcondition(bearZoneCross and barstate.isconfirmed, title = "Fusion Osc Bear Zone",
               message = "Fusion Oscillator: crossed below lower zone on {{ticker}} ({{interval}})")

alertcondition(midCrossUp and barstate.isconfirmed, title = "Fusion Osc Mid Cross Up",
               message = "Fusion Oscillator: crossed above midline on {{ticker}} ({{interval}})")

alertcondition(midCrossDown and barstate.isconfirmed, title = "Fusion Osc Mid Cross Down",
               message = "Fusion Oscillator: crossed below midline on {{ticker}} ({{interval}})")

Overview

Capital41 Fusion Oscillator v3 evaluates four criteria: EMA trend direction, RSI oversold or overbought turns, Williams %R thresholds, and ATR and volume expansion. Values above 75 indicate strong bullish confluence, while values below 25 signal bearish confluence. Users can adjust oscillator smoothing, horizontal zone levels, trend and momentum periods, and reversal turn strictness to match companion strategy settings.

Details

Published by

damianpitt on GitHub

Code credit

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

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Oscillators & momentum, Trend, Volatility & bands, Volume

Markets

Crypto, Stocks

Timeframes

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
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
Volume SMA lengthint50volLen
Show all 16 settings
SettingTypeDefaultVariable
Volume multiplierfloat1.0volMult
Oscillator smoothingint3oscSmooth
Show 25/50/75 zonesbooltrueshowZones
Background highlightbooltrueshowBg
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
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
147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups

Indicator v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of AI SuperTrend Clustering Oscillator [LuxAlgo]

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