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.
// 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.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
MA type
string
EMA
maType
MA length
int
50
maLen
RSI length
int
14
rsiLen
RSI overbought
int
65
rsiOB
RSI oversold
int
35
rsiOS
Williams %R length
int
14
wrLen
Williams %R overbought
float
-20.0
wrOB
Williams %R oversold
float
-80.0
wrOS
Sweep lookback
int
20
sweepLookback
Volume SMA length
int
50
volLookback
Min volume ratio
float
1.2
minVolRatio
Signal strictness
string
Standard
signalMode
Show all 16 settings
Setting
Type
Default
Variable
Zone buffer
int
5
zoneBuffer
Show moving average
bool
true
showMA
Show confluence signals
bool
true
showSignals
Show status badge
bool
true
showBadge
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.
This overlay indicator marks a four-stage bullish entry ladder on the price chart. It tracks fast and slow EMAs, swing structure, break of structure or change of character, liquidity sweep or reclaim, and optional displacement candles. Volume type, a multi-len
This overlay indicator marks call and put setups from EMAs, RSI, MACD, and a SPY volume ratio. A call needs higher highs, RSI above its minimum, rising MACD, above-average proxy volume, and a rising trend EMA; a put reverses those tests. Early markers use an E
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
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
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
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