by damianpitt· code credited to Capital41 | MIT License
Capital41 Williams Flow Simple calculates current and higher-timeframe Williams %R values alongside a volume filter to identify trend regimes and momentum entries.
// Copyright (c) 2026 Capital41 | MIT License
// CAPITAL41 WILLIAMS FLOW SIMPLE v2
// What it does:
// - Uses higher timeframe Williams %R as a regime filter (bull, bear, chop).
// - Triggers flow signals when current Williams %R exits oversold/overbought
// with a volume confirmation.
// - Background shading shows the regime for quick context.
//
// v2 changes:
// - FIXED: Williams %R line color changed from color.black (invisible on dark
// themes) to a user-configurable input color (default: teal).
//
// 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) Set Higher timeframe to 240 for 30m charts, or 1D for 4h charts.
//
// Usage guide (30m/4h):
// - Use Flow signals only in the direction of the HTF regime.
// - Avoid signals in chop (gray background).
// - Combine with sweeps or MA trend for higher quality entries.
//@version=6
indicator("Capital41 Williams Flow Simple v2", overlay = false, max_labels_count = 50)
// Inputs tuned for 30m-4H
len = input.int(14, "Williams %R length", minval = 2)
htf = input.timeframe("240", "Higher timeframe")
volLookback = input.int(50, "Volume SMA length", minval = 5)
volMult = input.float(0.7, "Volume filter multiplier", minval = 0.1, maxval = 2.0)
showBg = input.bool(true, "Show regime background")
showSignals = input.bool(true, "Show flow signals")
wrLineColor = input.color(color.teal, "Williams %R line color") // v2: user-configurable color
colorBull = color.new(color.lime, 0)
colorBear = color.new(color.red, 0)
colorChop = color.new(color.gray, 90)
// 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
wrCurr = wr_manual(high, low, close, len)
wrHTF = request.security(syminfo.tickerid, htf, wr_manual(high, low, close, len), lookahead = barmerge.lookahead_off)
// Regime
regimeBull = wrHTF > -45
regimeBear = wrHTF < -55
regimeChop = not (regimeBull or regimeBear)
// Volume filter
volSma = ta.sma(volume, volLookback)
volOK = volume > volSma * volMult
// Flow signals
os = -80.0
ob = -20.0
flowLong = showSignals and regimeBull and volOK and wrCurr > os and wrCurr[1] <= os and barstate.isconfirmed
flowShort = showSignals and regimeBear and volOK and wrCurr < ob and wrCurr[1] >= ob and barstate.isconfirmed
// Plots (v2: wrLineColor replaces color.black)
plot(wrCurr, title = "Williams %R", color = wrLineColor, linewidth = 2)
hline(os, "Oversold", color = color.new(colorBull, 50))
hline(ob, "Overbought", color = color.new(colorBear, 50))
bgcolor(showBg ? (regimeBull ? color.new(colorBull, 92) : regimeBear ? color.new(colorBear, 92) : colorChop) : na)
plotshape(flowLong, title = "Flow Long", style = shape.triangleup,
location = location.bottom, color = colorBull, size = size.tiny, text = "L")
plotshape(flowShort, title = "Flow Short", style = shape.triangledown,
location = location.top, color = colorBear, size = size.tiny, text = "S")
alertcondition(flowLong, title = "Flow Long",
message = "Williams Flow: long signal on {{ticker}} ({{interval}})")
alertcondition(flowShort, title = "Flow Short",
message = "Williams Flow: short signal on {{ticker}} ({{interval}})")
Overview
Capital41 Williams Flow Simple v2 defines bullish, bearish, or chop market regimes using the higher-timeframe Williams %R. Entry signals trigger in a separate pane when the current timeframe oscillator exits oversold or overbought zones with volume above a customizable moving average threshold, aligned with the higher-timeframe trend direction. Settings allow users to adjust timeframe inputs, volume filters, signal displays, and visual themes.
Higher-timeframe Williams %R regime classification
Volume-confirmed flow signal generation
Customizable higher-timeframe and oscillator length settings
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Williams %R length
int
14
len
Higher timeframe
timeframe
240
htf
Volume SMA length
int
50
volLookback
Volume filter multiplier
float
0.7
volMult
Show regime background
bool
true
showBg
Show flow signals
bool
true
showSignals
Williams %R line color
color
color.teal
wrLineColor
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.
FlowBias calculates a composite market momentum metric using Chaikin Money Flow, volume delta, Stochastic, and the Ultimate Oscillator. Plotted in a separate pane, it identifies trend pullbacks and market exhaustion reversals through visual signals and labels.
Nexural Pressure Pro is a composite pressure indicator that measures directional market momentum using volume-weighted directional movement, order flow delta, aggression, and efficiency ratio metrics. It filters out low-activity bars using configurable volume
PaperHands is an indicator that plots entry, re-entry, and exit signals for LONG and SHORT positions in a separate pane. It calculates signals using multiple confluence conditions such as real candle color, Heikin-Ashi candle color and flat bottoms or tops, He
This indicator combines five normalized oscillator channels: RSI, stochastic, MACD histogram, money flow index, and the ADX directional difference. It cross-subtracts channel pairs with a fixed or correlation-based weight meant to reduce shared overlap, then s
The Directional Flow Oscillator combines momentum, cumulative volume delta, price range position, trend ratio, and relative volatility into a single bounded composite indicator. It fetches lower-timeframe volume data to calculate cumulative volume delta and no
This indicator evaluates market sentiment and momentum using Aroon crossovers, intra-bar buy and sell volume estimation, and an ATR-based calculation. It generates modular buy and sell conditions filtered by volume thresholds, percentage bands, and Aroon signa