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
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน