Pine Script Woodie Pivots

Master this unique pivot point system in TradingView's Pine Script that emphasizes the previous day's closing price, making it particularly reactive for identifying intraday trading opportunities and trends.

Subscribe now @ $99/month

What are Woodie Pivots?

Woodie Pivots are a set of support and resistance levels primarily used by short-term traders, particularly intraday traders. They are distinct from Classic Pivots because their central Pivot Point calculation places a much heavier emphasis on the previous period's closing price. This makes Woodie Pivots highly reactive to recent market sentiment and momentum, as opposed to the broader average used in Classic Pivots.

Developed by Ken Wood, Woodie Pivots derive their levels from the previous day's (or chosen period's) High, Low, and Closing prices. They typically consist of a central Pivot Point (PP), two resistance levels (R1, R2), and two support levels (S1, S2). Some variations also include R3 and S3.

Traders primarily use Woodie Pivots for:

In Pine Script, Woodie Pivots offer a dynamic and responsive set of levels for short-term trading pine script strategies, particularly for those focusing on momentum and reactive trading.

Components and Calculation (Woodie Pivots)

Woodie Pivots are calculated using the previous period's High, Low, and Close prices, with the most significant difference being in the Pivot Point (PP) formula:


Let `H`, `L`, `C` be the previous period's High, Low, and Close.
  1. Pivot Point (PP): Woodie's PP strongly emphasizes the previous close.
    `PP = (C * 2 + H + L) / 4`
  2. First Resistance (R1):
    `R1 = (2 * PP) - Low`
  3. First Support (S1):
    `S1 = (2 * PP) - High`
  4. Second Resistance (R2):
    `R2 = PP + (High - Low)` `R2 = PP + (R1 - PP)` (Alternative, based on PP and R1 distance)
  5. Second Support (S2):
    `S2 = PP - (High - Low)` `S2 = PP - (PP - S1)` (Alternative, based on PP and S1 distance)
  6. Third Resistance (R3):
    `R3 = R2 + (High - Low)` (Often derived from R2 and Range)
  7. Third Support (S3):
    `S3 = S2 - (High - Low)` (Often derived from S2 and Range)

These levels remain constant throughout the current trading day and are recalculated at the start of the next trading day (or chosen period).

Basic Woodie Pivots Implementation in Pine Script

Pine Script v5 provides a built-in function `ta.pivotpoints()` that can calculate various pivot types, including "Woodie". This simplifies the implementation significantly.


//@version=5
indicator("My Woodie Pivots", overlay=true, max_bars_back=500) // overlay=true to plot on price chart.

// Input for the Pivot Point calculation timeframe
// Woodie pivots are predominantly used for intraday trading, so "D" (Daily) is most common.
pivotTimeframe = input.string("D", title="Pivot Timeframe", options=["D", "W", "M"])

// Get the Pivot Points values using ta.pivotpoints() with "Woodie" type
// This function returns a tuple: [pp, r1, r2, r3, s1, s2, s3]
[pp, r1, r2, r3, s1, s2, s3] = ta.pivotpoints("Woodie", pivotTimeframe, high, low, close, 1) // `1` indicates to look back 1 period for HLC

// Plotting the Woodie Levels
plot(pp, title="Woodie PP", color=color.purple, linewidth=2, style=plot.style_stepline)
plot(r1, title="Woodie R1", color=color.red, linewidth=1, style=plot.style_stepline)
plot(r2, title="Woodie R2", color=color.red, linewidth=1, style=plot.style_stepline)
plot(r3, title="Woodie R3", color=color.red, linewidth=1, style=plot.style_stepline)
plot(s1, title="Woodie S1", color=color.green, linewidth=1, style=plot.style_stepline)
plot(s2, title="Woodie S2", color=color.green, linewidth=1, style=plot.style_stepline)
plot(s3, title="Woodie S3", color=color.green, linewidth=1, style=plot.style_stepline)

// Optional: Add labels to the pivot lines for clarity (only on the first bar of a new period)
var label pp_label = na
var label r1_label = na
var label r2_label = na
var label r3_label = na
var label s1_label = na
var label s2_label = na
var label s3_label = na

// Check if it's the first bar of the new period (e.g., new day)
isNewPeriod = ta.change(time(pivotTimeframe))

if isNewPeriod
    label.delete(pp_label)
    label.delete(r1_label)
    label.delete(r2_label)
    label.delete(r3_label)
    label.delete(s1_label)
    label.delete(s2_label)
    label.delete(s3_label)

    pp_label := label.new(bar_index, pp, text="PP", style=label.style_label_left, color=color.new(color.purple, 70), textcolor=color.white)
    r1_label := label.new(bar_index, r1, "R1", style=label.style_label_left, color=color.new(color.red, 70), textcolor=color.white)
    r2_label := label.new(bar_index, r2, "R2", style=label.style_label_left, color=color.new(color.red, 70), textcolor=color.white)
    r3_label := label.new(bar_index, r3, "R3", style=label.style_label_left, color=color.new(color.red, 70), textcolor=color.white)
    s1_label := label.new(bar_index, s1, "S1", style=label.style_label_left, color=color.new(color.green, 70), textcolor=color.white)
    s2_label := label.new(bar_index, s2, "S2", style=label.style_label_left, color=color.new(color.green, 70), textcolor=color.white)
    s3_label := label.new(bar_index, s3, "S3", style=label.style_label_left, color=color.new(color.green, 70), textcolor=color.white)

// Extend labels horizontally
label.set_x(pp_label, bar_index)
label.set_x(r1_label, bar_index)
label.set_x(r2_label, bar_index)
label.set_x(r3_label, bar_index)
label.set_x(s1_label, bar_index)
label.set_x(s2_label, bar_index)
label.set_x(s3_label, bar_index)
Close Price Focus: Woodie Pivots' unique strength lies in their strong emphasis on the previous day's closing price in the Pivot Point calculation, making them very responsive to recent market sentiment.

Practical Woodie Pivots Trading Strategies

1. Pivot Point (PP) as Intraday Trend Bias

The central Woodie Pivot Point (PP) is a crucial level. Price action relative to PP can strongly indicate the intraday trend bias.


//@version=5
strategy("Woodie PP Trend Bias Strategy", overlay=true)

pivotTimeframe = input.string("D", title="Pivot Timeframe", options=["D", "W", "M"])
[pp, r1, r2, r3, s1, s2, s3] = ta.pivotpoints("Woodie", pivotTimeframe, high, low, close, 1)

// Plotting (simplified for strategy example)
plot(pp, title="Woodie PP", color=color.purple, linewidth=2, style=plot.style_stepline)

// Determine intraday bias based on price relative to PP
isBullishBias = close > pp
isBearishBias = close < pp

// Color background to easily visualize bias
bgcolor(isBullishBias ? color.new(color.teal, 95) : na, title="Bullish Intraday Bias")
bgcolor(isBearishBias ? color.new(color.maroon, 95) : na, title="Bearish Intraday Bias")

// Simple entry/exit based on PP crossovers
longCondition = ta.crossover(close, pp)
shortCondition = ta.crossunder(close, pp)

if (longCondition)
    strategy.entry("Long PP Cross", strategy.long)

if (shortCondition)
    strategy.entry("Short PP Cross", strategy.short)

// Basic exit: opposite signal
strategy.close("Long PP Cross", when=shortCondition)
strategy.close("Short PP Cross", when=longCondition)

2. Range Trading (Between S1 and R1)

Woodie's R1 and S1 often define a narrow, high-probability range for mean-reverting strategies, especially if price opens within this range. The idea is that price is likely to revert towards the PP or the opposite level.


//@version=5
strategy("Woodie Range Trading Strategy", overlay=true)

pivotTimeframe = input.string("D", title="Pivot Timeframe", options=["D", "W", "M"])
[pp, r1, r2, r3, s1, s2, s3] = ta.pivotpoints("Woodie", pivotTimeframe, high, low, close, 1)

// Plotting (simplified for strategy example)
plot(r1, title="R1", color=color.red, linewidth=1, style=plot.style_stepline)
plot(s1, title="S1", color=color.green, linewidth=1, style=plot.style_stepline)
plot(pp, title="PP", color=color.purple, linewidth=2, style=plot.style_stepline)

// Check if price is within R1/S1 range (or near it)
isPriceInInnerRange = close < r1 and close > s1

// Long entry: Price bounces from S1 (or near it) and is currently in inner range.
// (Simplified: Price closes above S1 after touching it)
longCondition = close > s1 and close[1] <= s1[1] and isPriceInInnerRange[1]

// Short entry: Price bounces from R1 (or near it) and is currently in inner range.
// (Simplified: Price closes below R1 after touching it)
shortCondition = close < r1 and close[1] >= r1[1] and isPriceInInnerRange[1]

if (longCondition)
    strategy.entry("Long S1 Bounce", strategy.long)

if (shortCondition)
    strategy.entry("Short R1 Rejection", strategy.short)

// Exit: Target PP or opposite pivot level. Stop loss beyond S2/R2.
strategy.exit("Long S1 Bounce Exit", from_entry="Long S1 Bounce", profit=r1, stop=s2)
strategy.exit("Short R1 Rejection Exit", from_entry="Short R1 Rejection", profit=s1, stop=r2)

3. Breakout Trading (Beyond R2 and S2)

While Woodie Pivots are great for ranges, a strong breakout beyond R2 or S2 (and potentially R3/S3) with high volume can signal a powerful trending day, indicating that the previous day's range is being decisively overcome.


//@version=5
strategy("Woodie Breakout Strategy", overlay=true)

pivotTimeframe = input.string("D", title="Pivot Timeframe", options=["D", "W", "M"])
[pp, r1, r2, r3, s1, s2, s3] = ta.pivotpoints("Woodie", pivotTimeframe, high, low, close, 1)

// Plotting (simplified for strategy example)
plot(r2, title="R2", color=color.red, linewidth=2, style=plot.style_stepline)
plot(s2, title="S2", color=color.green, linewidth=2, style=plot.style_stepline)

// Breakout logic: Price closes decisively above/below R2 or S2
longBreakoutCondition = close > r2 and close[1] <= r2[1]
shortBreakoutCondition = close < s2 and close[1] >= s2[1]

// Optional: Add volume confirmation for breakouts
volumeFactor = input.float(1.5, title="Volume Confirmation Factor", minval=1.0, step=0.1)
avgVolume = ta.sma(volume, 20)
isHighVolume = volume > avgVolume * volumeFactor

if (longBreakoutCondition and isHighVolume)
    strategy.entry("Long R2 Breakout", strategy.long)

if (shortBreakoutCondition and isHighVolume)
    strategy.entry("Short S2 Breakout", strategy.short)

// Exit: Fixed profit/loss or target a fixed number of ATRs
atrLength = input.int(14, title="ATR Length for Exits", minval=1)
atrValue = ta.atr(atrLength)
profitMultiplier = input.float(2.0, title="Profit Target (ATR)", minval=0.5, step=0.1)
stopLossMultiplier = input.float(1.0, title="Stop Loss (ATR)", minval=0.1, step=0.1)

strategy.exit("Long R2 Breakout Exit", from_entry="Long R2 Breakout", 
             profit=strategy.position_avg_price + atrValue * profitMultiplier, 
             stop=strategy.position_avg_price - atrValue * stopLossMultiplier)

strategy.exit("Short S2 Breakout Exit", from_entry="Short S2 Breakout", 
             profit=strategy.position_avg_price - atrValue * profitMultiplier, 
             stop=strategy.position_avg_price + atrValue * stopLossMultiplier)

Optimizing Woodie Pivots Performance

To get the most from Woodie Pivots in Pine Script:

Reactive to Recent Price: Woodie Pivots' emphasis on the previous close makes them highly reactive to the most recent significant price data, which is ideal for short-term and active traders.

Common Woodie Pivots Pitfalls

Conclusion

Woodie Pivots are a dynamic and highly reactive set of support and resistance levels available in Pine Script for TradingView. By uniquely emphasizing the previous day's closing price in their calculation, they provide a sensitive framework for navigating intraday price movements, confirming trend biases, and identifying potential reversal or breakout opportunities. While primarily suited for short-term and active traders, their effectiveness is significantly enhanced when combined with other confirming indicators like candlestick patterns, volume, and momentum oscillators. By understanding their calculation, applying them to appropriate timeframes, and integrating them strategically into your pine script strategies, you can leverage Woodie Pivots to improve your entry/exit timing and manage risk in dynamic markets.

Enhance Your Trading

Get a high-performance Pine Script analysis tool for actionable market insights, designed for traders on the move.

This strategy runs in live mode on TradingView, helping you identify potential opportunities.

Subscribe now @ $99/month