Indicator · Pine Script v6 · On the chart

Capital41 Confluence Core

by damianpitt· code credited to Capital41 | MIT License

Capital41 Confluence Core plots an EMA or SMA on the price chart and combines its direction with RSI, Williams %R, and a liquidity-sweep check into long and short confluence signals.

View on GitHub

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

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

Capital41_Confluence_Core.pine
// Copyright (c) 2026 Capital41 | MIT License
// CAPITAL41 CONFLUENCE CORE

// What it does:
// - Combines trend (MA), RSI, Williams %R, and Liquidity Sweep into one clear
//   long/short signal.
// - Includes a compact single-row status badge on the last bar.
// - Non-repainting: signals only after bar close.
//
// TradingView setup:
// 1) Open TradingView -> Pine Editor.
// 2) Paste this script, Save, and Add to chart.
// 3) Use 30m or 4h on BTC or US stocks.
// 4) Adjust Signal strictness to control frequency.

// Usage guide (30m/4h):
// - Standard mode is balanced. Use Strict for fewer signals, Loose for more.
// - Trend filter uses MA; signals only fire with the MA direction.
// - Liquidity sweeps confirm reversal into the trend direction.



//@version=6
indicator("Capital41 Confluence Core", overlay = true, max_labels_count = 50)

// Inputs tuned for 30m-4H
maType        = input.string("EMA", "MA type", options = ["EMA", "SMA"])
maLen         = input.int(50, "MA length", minval = 5)

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

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

sweepLookback = input.int(20, "Sweep lookback", minval = 5)
volLookback   = input.int(50, "Volume SMA length", minval = 5)
minVolRatio   = input.float(1.2, "Min volume ratio", minval = 1.0, maxval = 3.0)

signalMode    = input.string("Standard", "Signal strictness", options = ["Strict", "Standard", "Loose"])
zoneBuffer    = input.int(5, "Zone buffer", minval = 0, maxval = 20)

showMA        = input.bool(true, "Show moving average")
showSignals   = input.bool(true, "Show confluence signals")
showBadge     = input.bool(true, "Show status badge")

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


// Moving average
ma = maType == "EMA" ? ta.ema(close, maLen) : ta.sma(close, maLen)
plot(showMA ? ma : na, title = "MA", color = color.new(color.gray, 0), linewidth = 2)

// RSI
rsi = ta.rsi(close, rsiLen)
rsiOSLoose = rsiOS + zoneBuffer
rsiOBLoose = rsiOB - zoneBuffer

rsiLongStrict   = rsi < rsiOS and rsi > rsi[1]
rsiLongStandard = rsi < rsiOS or (rsi < rsiOSLoose and rsi > rsi[1])
rsiLongLoose    = rsi < rsiOSLoose

rsiShortStrict   = rsi > rsiOB and rsi < rsi[1]
rsiShortStandard = rsi > rsiOB or (rsi > rsiOBLoose and rsi < rsi[1])
rsiShortLoose    = rsi > rsiOBLoose

rsiLong  = signalMode == "Strict" ? rsiLongStrict : signalMode == "Loose" ? rsiLongLoose : rsiLongStandard
rsiShort = signalMode == "Strict" ? rsiShortStrict : signalMode == "Loose" ? rsiShortLoose : rsiShortStandard

// 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)
wrOSLoose = wrOS + zoneBuffer
wrOBLoose = wrOB - zoneBuffer
wrLongStrict   = wr < wrOS and wr > wr[1]
wrLongStandard = wr < wrOS or (wr < wrOSLoose and wr > wr[1])
wrLongLoose    = wr < wrOSLoose
wrShortStrict   = wr > wrOB and wr < wr[1]
wrShortStandard = wr > wrOB or (wr > wrOBLoose and wr < wr[1])
wrShortLoose    = wr > wrOBLoose

wrLong  = signalMode == "Strict" ? wrLongStrict : signalMode == "Loose" ? wrLongLoose : wrLongStandard
wrShort = signalMode == "Strict" ? wrShortStrict : signalMode == "Loose" ? wrShortLoose : wrShortStandard

// Liquidity sweep
priorHigh = ta.highest(high[1], sweepLookback)
priorLow  = ta.lowest(low[1],  sweepLookback)

volSma   = ta.sma(volume, volLookback)
volRatio = volSma > 0 ? volume / volSma : 0
volThresh = signalMode == "Strict" ? minVolRatio * 1.2 : signalMode == "Loose" ? minVolRatio * 0.9 : minVolRatio
highVol  = volRatio >= volThresh

bullSweep = low < priorLow and close >= priorLow and highVol and barstate.isconfirmed
bearSweep = high > priorHigh and close <= priorHigh and highVol and barstate.isconfirmed

// Confluence
trendLong  = close > ma
trendShort = close < ma

longSignal  = showSignals and trendLong and bullSweep and rsiLong and wrLong
shortSignal = showSignals and trendShort and bearSweep and rsiShort and wrShort

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

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

alertcondition(longSignal, title = "Confluence Long",
               message = "Confluence Core: long signal - MA + RSI + W%R + Sweep aligned on {{ticker}} ({{interval}})")

alertcondition(shortSignal, title = "Confluence Short",
               message = "Confluence Core: short signal - MA + RSI + W%R + Sweep aligned on {{ticker}} ({{interval}})")

// Status badge (single row)
var table status = table.new(position.top_right, 5, 1, border_width = 1)


if barstate.islast
    if showBadge
        maText = trendLong ? "MA+" : trendShort ? "MA-" : "MA0"
        swText = bullSweep ? "SW+" : bearSweep ? "SW-" : "SW0"
        rsiText = rsiLong ? "RSI+" : rsiShort ? "RSI-" : "RSI0"
        wrText = wrLong ? "WR+" : wrShort ? "WR-" : "WR0"
        sigText = longSignal ? "SIG L" : shortSignal ? "SIG S" : "SIG -"

        table.cell(status, 0, 0, maText, bgcolor = trendLong ? color.new(colorBull, 70) : trendShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = size.tiny)
        table.cell(status, 1, 0, swText, bgcolor = bullSweep ? color.new(colorBull, 70) : bearSweep ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = size.tiny)
        table.cell(status, 2, 0, rsiText, bgcolor = rsiLong ? color.new(colorBull, 70) : rsiShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = size.tiny)
        table.cell(status, 3, 0, wrText, bgcolor = wrLong ? color.new(colorBull, 70) : wrShort ? color.new(colorBear, 70) : colorNeutral, text_color = color.white, text_size = size.tiny)
        table.cell(status, 4, 0, sigText, bgcolor = longSignal ? color.new(colorBull, 60) : shortSignal ? color.new(colorBear, 60) : colorNeutral, text_color = color.white, text_size = size.tiny)
    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

Signal strictness is Strict, Standard, or Loose, which changes how far the oscillators must sit beyond overbought or oversold levels and whether they must turn. Sweeps use a lookback and a minimum volume ratio versus a volume SMA. A single-row status badge can appear on the last bar. The script states that signals print only after the bar closes.

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

Oscillators & momentum, Moving averages, SMC / ICT / price action, Volume

Markets

Crypto, Stocks

Timeframes

M15-H1, H4 and above

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
MA typestringEMAmaType
MA lengthint50maLen
RSI lengthint14rsiLen
RSI overboughtint65rsiOB
RSI oversoldint35rsiOS
Williams %R lengthint14wrLen
Williams %R overboughtfloat-20.0wrOB
Williams %R oversoldfloat-80.0wrOS
Sweep lookbackint20sweepLookback
Volume SMA lengthint50volLookback
Min volume ratiofloat1.2minVolRatio
Signal strictnessstringStandardsignalMode
Show all 16 settings
SettingTypeDefaultVariable
Zone bufferint5zoneBuffer
Show moving averagebooltrueshowMA
Show confluence signalsbooltrueshowSignals
Show status badgebooltrueshowBadge
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

LiqSpikeBounceLong Feb2026

by agutinbaigo28
147 stars

LiqSpikeBounceLong Feb2026 is an indicator designed to identify long bounce entries following high-volume liquidation cascades in bearish market contexts. It checks if price is below an exponential moving average, then detects large single-bar drops exceeding

Indicator v5 Volatility & bandsVolume
Updated 6 weeks ago · MIT GitHub repository of LiqSpikeBounceLong Feb2026

Signal Strategy 15m

by tripolskypetr
72 stars

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem

Indicator v5 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Signal Strategy 15m
46 stars

This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of SuperTrend + MACD + EMA

Bte Acc

by f-cksociety
11 stars

Bte Acc is a chart indicator form of the PineCoders Backtesting and Trading Engine. It seeks an entry trigger from a main or alternate entry method, then checks trade direction, filters, date range, ATR readiness, and remaining capital before filling on the ne

Indicator v5 TrendOscillators & momentum Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Bte Acc

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