Indicator · Pine Script v6 · On the chart

Ultimate Wyckoff Indicator V3 (Refined)

by loopofM

This overlay indicator marks Wyckoff-style buying and selling climaxes on the price chart.

View on GitHub

GitHub stars10on the repository
Pine versionv6current
Lines of code110
Settings11inputs
LicenceMIT
Last update1 year ago14 Dec 2024

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

110 lines of Pine Script v6 from wyckoff_script_v3.pinescript, published under MIT. Keep the author's credit and licence lines when you reuse it.

wyckoff_script_v3.pinescript
//@version=6
indicator("Ultimate Wyckoff Indicator V3 (Refined)", overlay=true)

// Parameters
swingLength = input.int(10, title="Swing Length for Accumulation/Distribution Detection")
volLength = input.int(20, title="Volume Moving Average Length")
volMultiplier = input.float(1.5, title="Volume Spike Multiplier")
usePriceAsVolume = input.bool(false, title="Use Price Instead of Volume (for Indices)")
atrLength = input.int(14, title="ATR Length for Volatility-based Zones")
emaLength = input.int(50, title="Trend Confirmation EMA Length")
minEventSpacing = input.int(10, title="Minimum Event Spacing (Bars)")
patternLength = input.int(7, title="Pattern Recognition Length")
riskRewardFactor = input.float(2.0, title="Risk/Reward Ratio Factor")

mtfTimeframes = input.timeframe("60", title="Higher Timeframe for Confirmation")
mtfConfirmingEMA = input.int(100, title="EMA Length for Higher Timeframe")

trendEMA = ta.ema(close, emaLength)
isUptrend = close > trendEMA
isDowntrend = close < trendEMA

mtfEMA = request.security(syminfo.tickerid, mtfTimeframes, ta.ema(close, mtfConfirmingEMA))
isMTFUptrend = close > mtfEMA
isMTFDowntrend = close < mtfEMA

effectiveVolume = usePriceAsVolume ? hlc3 : volume
volMA = ta.sma(effectiveVolume, volLength)
isVolSpike = effectiveVolume > volMA * volMultiplier

swingHigh = ta.highest(high, swingLength) == high
swingLow = ta.lowest(low, swingLength) == low

var float lastResistance = na
var float lastSupport = na

if swingHigh
    lastResistance := high
if swingLow
    lastSupport := low

plot(lastResistance, color=color.red, title="Resistance Level", linewidth=1, style=plot.style_linebr)
plot(lastSupport, color=color.green, title="Support Level", linewidth=1, style=plot.style_linebr)

atr = ta.atr(atrLength)
smaClose = ta.sma(close, swingLength)
smaAtr = ta.sma(atr, swingLength)

isAccumulation = close < smaClose and atr < smaAtr and isUptrend and isMTFUptrend
isDistribution = close > smaClose and atr < smaAtr and isDowntrend and isMTFDowntrend

buyingClimax = isVolSpike and swingHigh
sellingClimax = isVolSpike and swingLow

phaseDuration = bar_index - ta.valuewhen(isAccumulation or isDistribution, bar_index, 0)
isProlongedPhase = phaseDuration > 10

isImportantBC = buyingClimax and isUptrend and close == lastResistance and isMTFUptrend
isImportantSC = sellingClimax and isDowntrend and close == lastSupport and isMTFDowntrend

var float lastEventTime = na
displayEvent = (isImportantBC or isImportantSC) and (na(lastEventTime) or (bar_index - lastEventTime >= minEventSpacing))

if displayEvent
    lastEventTime := bar_index

bcMarker = isImportantBC and displayEvent
scMarker = isImportantSC and displayEvent

prominentBC = isImportantBC and effectiveVolume == ta.highest(effectiveVolume, 20)
prominentSC = isImportantSC and effectiveVolume == ta.highest(effectiveVolume, 20)

if prominentBC
    label.new(bar_index, high + atr * 0.05, "BC: High Volume at Resistance\nPossible market reversal", style=label.style_label_up, color=color.blue, textcolor=color.white, size=size.normal)
    lastEventTime := bar_index
    alert("Prominent Buying Climax Detected: High Volume at Resistance!", alert.freq_once_per_bar_close)

if prominentSC
    // Plot SC label (Selling Climax) with text description
    label.new(bar_index, low - atr * 0.05, "SC: High Volume at Support\nPossible market reversal", style=label.style_label_down, color=color.orange, textcolor=color.white, size=size.normal)
    lastEventTime := bar_index
    alert("Prominent Selling Climax Detected: High Volume at Support!", alert.freq_once_per_bar_close)

plotshape(series=bcMarker, location=location.abovebar, color=color.blue, style=shape.triangleup, size=size.large, title="BC Visual Marker")
plotshape(series=scMarker, location=location.belowbar, color=color.orange, style=shape.triangledown, size=size.large, title="SC Visual Marker")

basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upperBB = basis + dev * 2
lowerBB = basis - dev * 2
plot(upperBB, color=color.red, title="Upper Bollinger Band", linewidth=1)
plot(lowerBB, color=color.green, title="Lower Bollinger Band", linewidth=1)

rsiValue = ta.rsi(close, 14)
rsiLow = ta.lowestbars(rsiValue, 14)
priceHigh = high
isRSIDivergence = priceHigh > priceHigh[1] and rsiValue < rsiValue[1]
plotshape(series=isRSIDivergence, location=location.abovebar, color=color.purple, style=shape.triangledown, title="RSI Divergence")

supportLevel = low - ta.atr(14)
resistanceLevel = high + ta.atr(14)
plot(supportLevel, color=color.green, title="Dynamic Support", linewidth=1, style=plot.style_line)
plot(resistanceLevel, color=color.red, title="Dynamic Resistance", linewidth=1, style=plot.style_line)

fastEMA = ta.ema(close, 9)
slowEMA = ta.ema(close, 21)
bullishCrossover = ta.crossover(fastEMA, slowEMA)
bearishCrossover = ta.crossunder(fastEMA, slowEMA)

plotshape(series=bullishCrossover, location=location.belowbar, color=color.green, style=shape.labelup, title="Bullish Crossover")
plotshape(series=bearishCrossover, location=location.abovebar, color=color.red, style=shape.labeldown, title="Bearish Crossover")

Overview

Ultimate Wyckoff Indicator V3 (Refined) filters trend with an exponential moving average and a higher-timeframe EMA, then flags accumulation or distribution when price and ATR sit relative to their swing averages and both trends agree. Volume spikes at swing highs or lows produce BC and SC labels and alerts when spacing rules pass. Swing highs and lows plot as support and resistance. Main inputs change swing length, volume sensitivity, ATR and EMA lengths, event spacing, and the confirmation timeframe. It is not a strategy and has no entries or exits.

Details

Published by

loopofM on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Volatility & bands, Volume, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

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.

Settings

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

SettingTypeDefaultVariable
Swing Length for Accumulation/Distribution Detectionint10swingLength
Volume Moving Average Lengthint20volLength
Volume Spike Multiplierfloat1.5volMultiplier
Use Price Instead of Volume (for Indices)boolfalseusePriceAsVolume
ATR Length for Volatility-based Zonesint14atrLength
Trend Confirmation EMA Lengthint50emaLength
Minimum Event Spacing (Bars)int10minEventSpacing
Pattern Recognition Lengthint7patternLength
Risk/Reward Ratio Factorfloat2.0riskRewardFactor
Higher Timeframe for Confirmationtimeframe60mtfTimeframes
EMA Length for Higher Timeframeint100mtfConfirmingEMA
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

[RS]Donchian Fans

by ricardosantos79
261 stars

This indicator plots Donchian Channel boundary lines along with dynamic fan projections directly on the price chart. It calculates the highest high, lowest low, and median price over a customizable lookback period. Whenever price establishes a new channel high

Indicator v4 Support & resistanceTrend
Updated 4 years ago · None stated GitHub repository of [RS]Donchian Fans

Snag - VWAP

by dearvn
257 stars

This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc

Indicator v5 Moving averagesVolatility & bands Repaints
Updated 6 weeks ago · None stated GitHub repository of Snag - VWAP

Dynamic Linear Regression

by TradersPost
218 stars

Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Dynamic Linear Regression

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope

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