indicator · on price · open source
Standard Pivot Points
Running…
Loading chart…
About
Standard floor-trader pivots computed from the prior bar's high, low and close: PP is the central balance, R1/R2 the upside reaction levels, S1/S2 the downside ones.
- Uses
highest(high,1)[1]andlowest(low,1)[1]so the levels update only when a new reference bar prints. - Classic levels most platforms default to; pairs well with intraday timeframes.
- Treat PP as fair value and R1/S1 as the first reaction zone.
Source code
//@version=5
indicator("Standard Pivot Points", overlay=true)
pp = (ta.highest(high, 1)[1] + ta.lowest(low, 1)[1] + close[1]) / 3
r1 = 2*pp - ta.lowest(low, 1)[1]
s1 = 2*pp - ta.highest(high, 1)[1]
r2 = pp + (ta.highest(high, 1)[1] - ta.lowest(low, 1)[1])
s2 = pp - (ta.highest(high, 1)[1] - ta.lowest(low, 1)[1])
p_PP = plot(pp, "PP", color=color.yellow, linewidth=2)
p_R1 = plot(r1, "R1", color=color.green, style=plot.style_linebr)
p_R2 = plot(r2, "R2", color=color.green, style=plot.style_linebr)
p_S1 = plot(s1, "S1", color=color.red, style=plot.style_linebr)
p_S2 = plot(s2, "S2", color=color.red, style=plot.style_linebr)
alertcondition(ta.crossover(close, r1), "Above R1", "Close crossed above R1")
alertcondition(ta.crossunder(close, s1), "Below S1", "Close crossed below S1")
No comments yet.
Sign in to comment.