OPEN-SOURCE SCRIPT
Simple CPR for intraday index trading

Simple CPR is an indicator that displays the Central Pivot Range (CPR) and Support-Resistance pivots. It offers granular customization across CPR, Floor pivots, Developing CPR, and Session High/Low levels.
Original concept from Larry Williams, Mark Fisher & Frank Ochoa
Modified from "CPR (Central Pivot Range)" script by ajithcpas
What is CPR (Central Pivot Range)?
The Central Pivot Range (CPR) is calculated from the previous period’s High (H), Low (L), and Close (C). It forms three levels:
• Pivot (P) = (H + L + C) / 3
• Top Central (TC) = ( P - BC) + P
• Bottom Central (BC) = ( H + L)/2
Together, these levels form a central zone representing the market’s “value area.” Price trading above the CPR typically indicates bullish sentiment, while trading below the CPR reflects bearish bias. A narrow CPR often precedes strong trending moves, whereas a wider CPR signals potential consolidation.
How Pivot Levels are Calculated
Beyond CPR, the indicator supports multiple pivot calculation models, including Traditional, Classic, Fibonacci, and Camarilla
For example, in the traditional model:
• R1 = ( 2 × P ) − L
• S1 = ( 2 × P ) − H
• Higher levels (R2, R3…) scale proportionally by the prior range (H-L).
These levels serve as dynamic intraday support-resistance zones and breakout targets.
Key Features
⦿ Multi-Formula CPR: Select Traditional, Classic, Fibonacci, or Camarilla pivots.
⦿ Multi-Timeframe Control: Auto-detect or manually set CPR timeframe (Daily → Yearly).
⦿ Complete Pivot Suite: Extending to five resistance and five support levels (R1–R5, S1–S5) with optional midpoints (R0.5, R1.5, R2.5, R3.5, R4.5, S0.5, S1.5, S2.5, S3.5, S4.5).All levels can be individually toggled on or off, giving traders complete control over the level of chart detail they prefer.
⦿ Full Customization: Independently toggle lines, fills, price labels, and level names.
⦿ Developing CPR & S/R: Real-time projection of next-session CPR, R1, and S1 with separate visibility controls.
⦿ Session High/Low Tracking: Plot Previous-Session High (PH) & Low (PL) with optional labels and prices.
⦿ Look-Back Flexibility: Display any number of historical CPR/pivot periods.
⦿ Styling Precision: Choose line width, style (solid, dashed, dotted), and individual colors.
⦿ Optional Fills: Visualize the CPR zone or CPR–R1/S1 bands with semi-transparent shading.
⦿ Optimized Performance: Efficient array-based drawing for smooth chart performance even with a long history.
Use Case
CPR analysis helps identify trend bias, volatility contraction/expansion, and key support-resistance zones. This indicator is ideal for intraday indices traders who need a structured yet customizable price-action framework.
Disclaimer
This script is for educational and technical analysis purposes only. It does not constitute financial advice or a recommendation. Always perform independent analysis and manage risk appropriately before placing trades.
Original concept from Larry Williams, Mark Fisher & Frank Ochoa
Modified from "CPR (Central Pivot Range)" script by ajithcpas
What is CPR (Central Pivot Range)?
The Central Pivot Range (CPR) is calculated from the previous period’s High (H), Low (L), and Close (C). It forms three levels:
• Pivot (P) = (H + L + C) / 3
• Top Central (TC) = ( P - BC) + P
• Bottom Central (BC) = ( H + L)/2
Together, these levels form a central zone representing the market’s “value area.” Price trading above the CPR typically indicates bullish sentiment, while trading below the CPR reflects bearish bias. A narrow CPR often precedes strong trending moves, whereas a wider CPR signals potential consolidation.
How Pivot Levels are Calculated
Beyond CPR, the indicator supports multiple pivot calculation models, including Traditional, Classic, Fibonacci, and Camarilla
For example, in the traditional model:
• R1 = ( 2 × P ) − L
• S1 = ( 2 × P ) − H
• Higher levels (R2, R3…) scale proportionally by the prior range (H-L).
These levels serve as dynamic intraday support-resistance zones and breakout targets.
Key Features
⦿ Multi-Formula CPR: Select Traditional, Classic, Fibonacci, or Camarilla pivots.
⦿ Multi-Timeframe Control: Auto-detect or manually set CPR timeframe (Daily → Yearly).
⦿ Complete Pivot Suite: Extending to five resistance and five support levels (R1–R5, S1–S5) with optional midpoints (R0.5, R1.5, R2.5, R3.5, R4.5, S0.5, S1.5, S2.5, S3.5, S4.5).All levels can be individually toggled on or off, giving traders complete control over the level of chart detail they prefer.
⦿ Full Customization: Independently toggle lines, fills, price labels, and level names.
⦿ Developing CPR & S/R: Real-time projection of next-session CPR, R1, and S1 with separate visibility controls.
⦿ Session High/Low Tracking: Plot Previous-Session High (PH) & Low (PL) with optional labels and prices.
⦿ Look-Back Flexibility: Display any number of historical CPR/pivot periods.
⦿ Styling Precision: Choose line width, style (solid, dashed, dotted), and individual colors.
⦿ Optional Fills: Visualize the CPR zone or CPR–R1/S1 bands with semi-transparent shading.
⦿ Optimized Performance: Efficient array-based drawing for smooth chart performance even with a long history.
Use Case
CPR analysis helps identify trend bias, volatility contraction/expansion, and key support-resistance zones. This indicator is ideal for intraday indices traders who need a structured yet customizable price-action framework.
Disclaimer
This script is for educational and technical analysis purposes only. It does not constitute financial advice or a recommendation. Always perform independent analysis and manage risk appropriately before placing trades.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.