Pattern

Pivot Points Trading Signals: Levels, Resets and Pine Script

Calculate Traditional pivot levels from a completed day, week or month. Read breakout and rejection rules, period-reset limits, and Pine Script v6 code.

Pivot Points Signal Interpretation

Quick-reference guide to 4 signal types you will see on the chart.

Signal TypeIndicator ConditionMarket MeaningInterpretation limits
R1 close breakoutA confirmed close crosses above R1, excluding the first chart bar of a new pivot period.Price has moved through the first resistance reference. This is a level-cross event.No volume, follow-through or profitability test is included.
S1 close breakdownA confirmed close crosses below S1, excluding the first chart bar of a new pivot period.Price has moved through the first support reference.A later close can return above S1; S2 is not a promised destination.
PP wick recoveryThe previous close is above PP; the current low touches or passes PP and the confirmed close finishes above it.Price tested the pivot and recovered before the close.This rule does not require a bullish candle body or a named candlestick pattern.
R1 wick rejectionThe previous close is below R1; the current high touches or passes R1 and the confirmed close finishes below it.Price tested R1 and returned below it before the close.Repeated tests can produce repeated signals. The rule does not identify who traded at the level.

Pivot Points Pine Script Signal Code

Educational indicator example. Review its exact rules and compare its plots with your intended calculation in TradingView. It does not place orders or establish profitability.

Pine Script v6
//@version=6
indicator("Traditional Pivot Level Signals", overlay=true)
pivotTf = input.timeframe("D", "Pivot Timeframe", options=["D", "W", "M"])
showOuter = input.bool(true, "Show R2/R3/S2/S3")
showSignals = input.bool(true, "Show Signal Markers")
if timeframe.in_seconds() >= timeframe.in_seconds(pivotTf)
    runtime.error("Use a chart timeframe lower than the pivot timeframe.")

// Completed higher-timeframe values are available at the new period's start.
[priorHigh, priorLow, priorClose] = request.security(syminfo.tickerid, pivotTf, [high[1], low[1], close[1]], lookahead=barmerge.lookahead_on)
pp = (priorHigh + priorLow + priorClose) / 3
r1 = 2 * pp - priorLow
s1 = 2 * pp - priorHigh
r2 = pp + priorHigh - priorLow
s2 = pp - priorHigh + priorLow
r3 = priorHigh + 2 * (pp - priorLow)
s3 = priorLow - 2 * (priorHigh - pp)
newPeriod = timeframe.change(pivotTf)
crossR1 = ta.crossover(close, r1)
crossS1 = ta.crossunder(close, s1)
ready = barstate.isconfirmed and not newPeriod and not na(pp) and not na(close[1])
breakR1 = ready and crossR1
breakS1 = ready and crossS1
recoverPP = ready and close[1] > pp and low <= pp and close > pp
rejectR1 = ready and close[1] < r1 and high >= r1 and close < r1

plot(pp, "PP", color.blue, 2, plot.style_stepline)
plot(r1, "R1", color.green, 1, plot.style_stepline)
plot(s1, "S1", color.red, 1, plot.style_stepline)
plot(showOuter ? r2 : na, "R2", color.new(color.green, 30), 1, plot.style_stepline)
plot(showOuter ? r3 : na, "R3", color.new(color.green, 50), 1, plot.style_stepline)
plot(showOuter ? s2 : na, "S2", color.new(color.red, 30), 1, plot.style_stepline)
plot(showOuter ? s3 : na, "S3", color.new(color.red, 50), 1, plot.style_stepline)
plotshape(showSignals and breakR1, "R1 Break", shape.triangleup, location.belowbar, color.green, text="R1")
plotshape(showSignals and breakS1, "S1 Break", shape.triangledown, location.abovebar, color.red, text="S1")
plotshape(showSignals and recoverPP, "PP Recovery", shape.diamond, location.belowbar, color.orange, text="PP")
plotshape(showSignals and rejectR1, "R1 Rejection", shape.diamond, location.abovebar, color.orange, text="REJ")
alertcondition(breakR1, "R1 Close Breakout", "Confirmed close crossed above R1")
alertcondition(breakS1, "S1 Close Breakdown", "Confirmed close crossed below S1")
alertcondition(recoverPP, "PP Wick Recovery", "Price tested PP and closed above it")
alertcondition(rejectR1, "R1 Wick Rejection", "Price tested R1 and closed below it")

Example settings for Pivot Points

Record the inputs used by the example. These settings are not an optimized trading recommendation.

Feature comparison table: Default vs Description
ParameterDefaultDescription
Pivot TimeframeDD, W or M selects the completed higher-timeframe candle used for the levels. The chart timeframe must be lower; for example, a 15-minute chart with D pivots.
Show R2/R3/S2/S3trueDisplays the four outer levels. PP, R1 and S1 remain visible when this is off. Seven levels are available in total.
Show Signal MarkerstrueControls shapes only. Turning markers off does not disable any of the four alert conditions.

Turn the condition into an explicit rule

Specify the calculation, confirmation time, entry and exit rules before asking Pineify to draft or revise Pine Script. Review the code and simulate realistic costs before evaluating a strategy.

Explore Pine Script coding

Related Resources

Pivot Points Pine Script ReferenceTradingView alert setup documentation

FAQ

Pivot Points Signals FAQ

Which pivot formula does this example use?
It uses Traditional pivots through R3 and S3. PP is the mean of the previous period high, low and close. R1 = 2PP - L, S1 = 2PP - H, R2 = PP + H - L, S2 = PP - H + L, R3 = H + 2(PP - L), and S3 = L - 2(H - PP). The Classic variant has different third-level formulas.
Can I check the levels with a numerical example?
For hypothetical previous-period prices H = 110, L = 100 and C = 105, PP is 105. R1/R2/R3 are 110/115/120, and S1/S2/S3 are 100/95/90. A same-period close moving from 109 to 111 crosses R1. A high of 111 followed by a close of 109 is instead an R1 rejection if the previous close was below 110.
Why are signals skipped on the first bar of a new period?
Pivot levels jump when a new reference period begins. A crossover can then result from the level moving rather than price crossing an unchanged level. The script suppresses all four events on that first chart bar. It consequently misses genuine first-bar breakouts too; this is an explicit tradeoff.
Do these levels repaint?
The request uses the previous completed higher-timeframe candle with a one-bar offset and lookahead_on. That combination avoids reading the developing period or leaking its final prices into historical bars. Levels remain fixed within the reference period under unchanged data, and signals wait for the chart bar close. Feed revisions, session changes and different chart data can still change historical results.
Why can the levels differ from TradingView Pivot Points Standard?
Match the Traditional formula, pivot timeframe and data settings first. This example requests higher-timeframe OHLC; it does not reconstruct a custom session from intraday candles. Daily and intraday feeds can differ, including futures settlement prices and extended-hours coverage. It also omits R4/R5/S4/S5. Use standard price candles when checking the calculation.
Are weekly or monthly pivots more accurate than daily pivots?
They use different reference periods, not a ranked accuracy scale. Weekly and monthly boundaries follow the requested symbol data, rather than a fixed number of intraday bars or milliseconds. A longer period changes the levels and how often they reset. No win-rate comparison or trading backtest is supplied here.
Does the code include RSI or automatic trade execution?
No. It marks four price-level events and exposes four alert conditions. RSI divergence, volume filters, entries, exits and position sizing would need separate rules. Create alerts from the desired condition and recreate them after changing the script or its inputs. A level touch or close beyond a line does not establish an executable fill price.