Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Indicator

Pivot Points Standard

A Pine Script v5 indicator built on Valuewhen (newPeriod, curHigh[1]). It draws 7 lines on the price chart. It declares 2 alerts. 2 settings; defaults include Period W.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Pivot Points Standard repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 300 of 300 bars.
How many settings does Pivot Points Standard have?
2
Defaults include Period W, Show R3 and S3 true.
What alerts does Pivot Points Standard have?
2
Close above R1; Close below S1.
Does Pivot Points Standard run in Pine Script v6?
Yes
Every plotted value identical on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. The v6 script can be downloaded below.
Does Pivot Points Standard draw on the price chart?
Yes
It is declared with overlay = true.

BTCUSDT · 1D · default settings

  • P
  • R1
  • S1
  • R2
  • S2
  • R3
  • S3
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (2)
50,00075,000100,000125,000150,000AprJulOct2025AprJulOct2026AprJulOct
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Lines and shading are what the script draws. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
P
82,089.30
on the last bar
R1
84,378.70
on the last bar
S1
79,826.70
on the last bar
R2
86,641.30
on the last bar
S2
77,537.30
on the last bar
R3
88,930.70
on the last bar

The value of each line the script plots, on the last of 1,000 bars, with the default settings.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Note

    1 setting has no label

    In the settings dialog period (line 6) shows an empty name. The labels on this page come from the variable names.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Period (no label in the script)WtimeframenewPeriod
Show R3 and S3trueboolR3 S3

What it calculates

  • ValuewhennewPeriod, curHigh[1], 0pHigh · line 19
  • ValuewhennewPeriod, curLow[1], 0pLow · line 20
  • ValuewhennewPeriod, close[1], 0pClose · line 21

Signal flow

How price data and settings reach what is drawn. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

closecloseprice dataperiodPeriodsetting · Whighhighprice datalowlowprice datapHighValuewhen→ pHighpLowValuewhen→ pLowpCloseValuewhen→ pClosenewPeriodnewPeriodvaluecurHighcurHighvaluecurLowcurLowvalueppppvaluer1r1values1s1valuer2, s2, r3, s3r2 · s2 +24 valuesplot:34Pplotplot:35R1plotplot:36S1plotplot:37R2plotplot:38S2plotplot:39R3plotplot:40S3plotalertcondition:42Close above R1alertconditionalertcondition:43Close below S1alertcondition

What it draws

OutputCallValueBy defaultLine
Pplotbrk(pp)Shown34
R1plotbrk(r1)Shown35
S1plotbrk(s1)Shown36
R2plotbrk(r2)Shown37
S2plotbrk(s2)Shown38
R3plotshowR3 ? brk(r3) : naShown “Show R3 and S3”39
S3plotshowR3 ? brk(s3) : naShown “Show R3 and S3”40

Alerts

AlertCallMessageLine
Close above R1alertconditionClose crossed above R142
Close below S1alertconditionClose crossed below S143

Does it repaint?

No

No repainting patterns in the source, and the live replay matched history.

300/300bars identical at close when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. On 0 of them the colour changed while the bar was forming before it settled.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip or realtime-only state. Values move while a bar forms and settle when it closes, as every indicator's do.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets, each the most recent 1,000 bars.

MarketPR1S1R2S2
BTCUSDT 1D82,089.3084,378.7079,826.7086,641.3077,537.30
BTCUSDT 4h82,089.3084,378.7079,826.7086,641.3077,537.30
ETHUSDT 1D2,436.062,554.132,292.252,697.942,174.18
ETHUSDT 4h2,436.062,554.132,292.252,697.942,174.18
SOLUSDT 1D105.98111.5398.56118.9593.01
SOLUSDT 4h105.98111.5398.56118.9593.01
BNBUSDT 1D729.08752.31700.14781.25676.91
BNBUSDT 4h729.08752.31700.14781.25676.91

Each line's value on the last bar.

Similar scripts

Indicators and strategies built from the same calculations.

ScriptSharesType
[LunaOwl] Support Resistance Strategy V4 by LunaOwlvaluewhenv4 strategy
Close Trade at end of day by daytraderphvaluewhenv4 strategy
1St Bar GAP+BkOut Screener v2 by RM by raul3429valuewhenv4 strategy
Period VWAP by Zeal Terminalvaluewhenv5 indicator
Reinforced RSI - The Quant Science by thequantsciencevaluewhenv5 strategy

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Yes

Every plotted value identical on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. It differs from the v5 version by 1 edit.

Download the v6 script

⋯// © Zeal Terminal-//@version=5+//@version=6indicator("Pivot Points Standard", shorttitle = "Pivots", overlay = true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 15 msWith a workaround 1,000 bars in 31 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.

Source

Written by Zeal Terminal and published under the Mozilla Public License 2.0.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © Zeal Terminal//@version=5indicator("Pivot Points Standard", shorttitle = "Pivots", overlay = true) period  = input.timeframe("W", "Pivot period")showR3  = input.bool(true, "Show R3 and S3") // Floor-trader pivots from the previous period's high, low and close,// tracked bar by bar so no higher-timeframe request is needed.newPeriod = timeframe.change(period) var float curHigh = navar float curLow  = nacurHigh := newPeriod ? high : math.max(nz(curHigh, high), high)curLow  := newPeriod ? low  : math.min(nz(curLow, low), low) // The finished period's values, captured on the first bar of the next one.pHigh  = ta.valuewhen(newPeriod, curHigh[1], 0)pLow   = ta.valuewhen(newPeriod, curLow[1], 0)pClose = ta.valuewhen(newPeriod, close[1], 0) // A gap at each period boundary, so one period's levels never join the next.brk(float x) => newPeriod ? na : x pp = (pHigh + pLow + pClose) / 3r1 = 2 * pp - pLows1 = 2 * pp - pHighr2 = pp + (pHigh - pLow)s2 = pp - (pHigh - pLow)r3 = pHigh + 2 * (pp - pLow)s3 = pLow - 2 * (pHigh - pp) plot(brk(pp), "P", color = #ffb74d, style = plot.style_linebr, linewidth = 2)plot(brk(r1), "R1", color = #ef5350, style = plot.style_linebr)plot(brk(s1), "S1", color = #26a69a, style = plot.style_linebr)plot(brk(r2), "R2", color = #ef5350, style = plot.style_linebr)plot(brk(s2), "S2", color = #26a69a, style = plot.style_linebr)plot(showR3 ? brk(r3) : na, "R3", color = #ef5350, style = plot.style_linebr)plot(showR3 ? brk(s3) : na, "S3", color = #26a69a, style = plot.style_linebr) alertcondition(ta.crossover(close, r1),  "Close above R1", "Close crossed above R1")alertcondition(ta.crossunder(close, s1), "Close below S1", "Close crossed below S1")