OPEN-SOURCE SCRIPT
Pivot Pro - CPR PDH/PDL EMA by Sani

═══════════════════════════════════════════════
PIVOT POINTS PRO — CPR + PDH/PDL + EMA
Full Historical | No Repaint | All Customizable
═══════════════════════════════════════════════
A professional all-in-one indicator combining the
Standard Pivot Point system with CPR (Central Pivot Range),
Previous Day High/Low, and dual EMAs — all non-repainting,
fully customizable per level, and drawn across complete
chart history.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔷 PIVOT POINTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Supports all 6 types: Traditional, Fibonacci,
Woodie, Classic, DM, Camarilla
- Timeframe anchoring: Auto, Daily, Weekly, Monthly,
Quarterly, Yearly, and multi-year periods
- Every level (P, R1–R5, S1–S5) has its own
independent Color, Line Style, and Line Width
- Lines extend to the right edge of the chart
- Historical pivot count controlled by "Number of Pivots Back"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 CPR — CENTRAL PIVOT RANGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Calculated from previous day OHLC (non-repainting)
- Draws CPR Pivot, BC (Bottom Central), TC (Top Central)
- Visible across ALL historical sessions — not just today
- Each line has its own Color, Style (Solid/Dashed/Dotted),
and Width
- Current session extends to right edge automatically
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔹 PDH / PDL — PREVIOUS DAY HIGH & LOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Previous day High and Low plotted per session
- Full chart history — every completed day visible
- Independent Show/Hide, Color, Style, and Width
for PDH and PDL separately
- Current session extends to right edge automatically
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 EMA — FAST & SLOW WITH TREND COLORING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Dual EMA (default 10 / 20) with dynamic color:
→ Green when Fast > Slow (bullish)
→ Red when Fast < Slow (bearish)
→ Yellow when flat
- Optional EMA Band background highlight (purple)
when price is between the two EMAs
- EMA Touch + 2-Candle confirmation alerts included
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Pivot Type & Timeframe
- Labels: Show/Hide, position (Left or Right), prices
- Per-level: P, R1–R5, S1–S5 — Color, Style, Width
- CPR: Master toggle + individual Pivot / BC / TC controls
- PDH/PDL: Master toggle + individual PDH / PDL controls
- EMA: Lengths, Width, Band background
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛡️ NO REPAINT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All values fetched using:
request.security(..., lookahead=barmerge.lookahead_on)
with [1] shift on daily OHLC — values are locked to
the previous completed day and never change on the
current bar.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 BEST USED ON
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Intraday timeframes: 1m, 3m, 5m, 15m, 30m, 1H
Works on any market: Stocks, Forex, Crypto, Futures
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 BUILT-IN ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- EMA Bullish Cross
- EMA Bearish Cross
- Price Touched PDH
- Price Touched PDL
- Price Near CPR Pivot
PIVOT POINTS PRO — CPR + PDH/PDL + EMA
Full Historical | No Repaint | All Customizable
═══════════════════════════════════════════════
A professional all-in-one indicator combining the
Standard Pivot Point system with CPR (Central Pivot Range),
Previous Day High/Low, and dual EMAs — all non-repainting,
fully customizable per level, and drawn across complete
chart history.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔷 PIVOT POINTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Supports all 6 types: Traditional, Fibonacci,
Woodie, Classic, DM, Camarilla
- Timeframe anchoring: Auto, Daily, Weekly, Monthly,
Quarterly, Yearly, and multi-year periods
- Every level (P, R1–R5, S1–S5) has its own
independent Color, Line Style, and Line Width
- Lines extend to the right edge of the chart
- Historical pivot count controlled by "Number of Pivots Back"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 CPR — CENTRAL PIVOT RANGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Calculated from previous day OHLC (non-repainting)
- Draws CPR Pivot, BC (Bottom Central), TC (Top Central)
- Visible across ALL historical sessions — not just today
- Each line has its own Color, Style (Solid/Dashed/Dotted),
and Width
- Current session extends to right edge automatically
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔹 PDH / PDL — PREVIOUS DAY HIGH & LOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Previous day High and Low plotted per session
- Full chart history — every completed day visible
- Independent Show/Hide, Color, Style, and Width
for PDH and PDL separately
- Current session extends to right edge automatically
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 EMA — FAST & SLOW WITH TREND COLORING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Dual EMA (default 10 / 20) with dynamic color:
→ Green when Fast > Slow (bullish)
→ Red when Fast < Slow (bearish)
→ Yellow when flat
- Optional EMA Band background highlight (purple)
when price is between the two EMAs
- EMA Touch + 2-Candle confirmation alerts included
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- Pivot Type & Timeframe
- Labels: Show/Hide, position (Left or Right), prices
- Per-level: P, R1–R5, S1–S5 — Color, Style, Width
- CPR: Master toggle + individual Pivot / BC / TC controls
- PDH/PDL: Master toggle + individual PDH / PDL controls
- EMA: Lengths, Width, Band background
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛡️ NO REPAINT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All values fetched using:
request.security(..., lookahead=barmerge.lookahead_on)
with [1] shift on daily OHLC — values are locked to
the previous completed day and never change on the
current bar.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 BEST USED ON
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Intraday timeframes: 1m, 3m, 5m, 15m, 30m, 1H
Works on any market: Stocks, Forex, Crypto, Futures
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 BUILT-IN ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- EMA Bullish Cross
- EMA Bearish Cross
- Price Touched PDH
- Price Touched PDL
- Price Near CPR Pivot
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.