OPEN-SOURCE SCRIPT

CPR by NKD

Zaktualizowano
Central Pivot Range (CPR) Trading Strategy:
The Central Pivot Range (CPR) is a widely-used tool in technical analysis, helping traders pinpoint potential support and resistance levels in the market. By using the CPR effectively, traders can better gauge market trends and determine favorable entry and exit points. This guide explores how the CPR works, outlines its calculation, and describes how traders can enhance their strategies using an extended 10-line version of CPR.

What Really Central Pivot Range (CPR) is?
At its core, the CPR consists of three key lines:

  1. Pivot Point (PP) – The central line, calculated as the average of the previous day’s high, low, and closing prices.
  2. Upper Range (R1) – Positioned above the Pivot Point, acting as a potential ceiling where price may face resistance.
  3. Lower Range (S1) – Found below the Pivot Point, serving as a potential floor where price might find support.


Advanced traders often expand on the traditional three-line CPR by adding extra levels above and below the pivot, creating up to a 10-line system. This extended CPR allows for a more nuanced understanding of the market and helps identify more detailed trading opportunities.

Applying CPR for Trading Success

1. How CPR is Calculation
The CPR relies on the previous day's high (H), low (L), and close (C) prices to create its structure:
Pivot Point (PP) = (H + L + C) / 3
First Resistance (R1) = (2 * PP) - L
First Support (S1) = (2 * PP) - H
Additional resistance levels (R2, R3) and support levels (S2, S3) are calculated by adding or subtracting multiples of the previous day’s price range (H - L) from the Pivot Point.

2. Recognizing the Market Trend
To effectively trade using CPR, it’s essential to first determine whether the market is trending up (bullish) or down (bearish). In an upward-trending market, traders focus on buying at support levels, while in a downward market, they look to sell near resistance.

3. Finding Ideal Entry Points
Traders often look to enter trades when price approaches key levels within the CPR range. Support levels (S1, S2) offer buying opportunities, while resistance levels (R1, R2) provide selling opportunities. These points are considered potential reversal zones, where price may bounce or reverse direction.

4. Managing Risk with Stop-Loss Orders
Proper risk management is crucial in any trading strategy. A stop-loss should be set slightly beyond the support level for buy positions and above the resistance level for sell positions, ensuring that losses are contained if the market moves against the trader’s position.

5. Determining Profit Targets
Profit targets are typically set based on the distance between entry points and the next support or resistance level. Many traders apply a risk-reward ratio, aiming for larger potential profits compared to the potential losses. However, if the next resistance and support level is far then middle levels are used for targets (i.e. 50% of R1 and R2)

6. Confirmation Through Other Indicators
While CPR provides strong support and resistance levels, traders often use additional indicators to confirm potential trade setups. Indicators such as moving averages can
help validate the signals provided by the CPR.

7. Monitoring Price Action At CPR Levels
Constantly monitoring price movement near CPR levels is essential. If the price fails to break through a resistance level (R1) or holds firm at support (S1), it can offer cues on when to exit or adjust a trade. However, a strong price break past these levels often signals a continued trend.

8. Trading Breakouts with CPR
When the price breaks above resistance or below support with strong momentum, it may signal a potential breakout. Traders can capitalize on these movements by entering positions in the direction of the breakout, ideally confirmed by volume or other technical indicators.

9. Adapting to Changing Market Conditions
CPR should be used in the context of broader market influences, such as economic reports, news events, or geopolitical shifts. These factors can dramatically affect market direction and how price reacts to CPR levels, making it important to stay informed about external market conditions.

10. Practice and Backtesting for Improvements
Like any trading tool, the CPR requires practice. Traders are encouraged to backtest their strategies on historical price data to get a better sense of how CPR works in different market environments. Continuous analysis and practice help improve decision-making and strategy refinement.

The Advantages of Using a 10-Line CPR System

An extended 10-line CPR system—comprising up to five resistance and five support levels—provides more granular control and insight into market movements. This expanded view helps traders better gauge trends and identify more opportunities for entry and exit. Key benefits include:

  • R2, S2 Levels: These act as secondary resistance or support zones, giving traders additional opportunities to refine their trade entries and exits.
  • R3, S3 Levels: Provide an even wider range for identifying reversals or trend continuations in more volatile markets.
  • Flexibility: The broader range of levels allows traders to adapt to changing market conditions and make more precise decisions based on market momentum.


So in Essential:

The Central Pivot Range is a valuable tool for traders looking to identify critical price levels in the market. By providing a clear framework for identifying potential support and resistance zones, it helps traders make informed decisions about entering and exiting trades. However, it’s important to combine CPR with sound risk management and additional confirmation through other technical indicators for the best results.

Although no trading tool guarantees success, the CPR, when used effectively and combined with practice, can significantly enhance a trader’s ability to navigate market fluctuations.
Informacje o Wersji
1. Fixed issue with Weekly and Monthly Pivots. Earlier these levels were being plotted in developing mode (candle by candle). Now these will be plotted for the particular length i.e. for 1 week for weekly and 1 month for monthly
2. With this labels for Weekly and Monthly pivots will be plotted every day so it becomes easier to know about the plotted level
3. Changed the colour and line style for weekly and monthly pivots along with fill so it does not look cluttered
4. Modified Previous Week and Previous Month high/low levels - earlier these levels were being plotted with extended line from left to right. Now these will be plotted like other Weekly and Monthly pivots
Informacje o Wersji
Now historical CPR will also show historical support and resistance levels.
Informacje o Wersji
Addition of one more Moving average. I have noticed that price most of the time is above 10 and 20 EMA in an uptrend and takes support on a pullback. if there is a strong pullback, EMA 50 will provide support. Price below 200 EMA is a sign of weakness in uptrend and trend reversal likely to happen. Same is reversed in case of a downtrend.
Informacje o Wersji
minor code fix
centralpivotrangeCPRcprfortomorrowcprindicatorcprstrategymovingavaragemulti-timeframePivot PointsPivot points and levelsSupport and Resistancetrendanalyisisvwaps

Skrypt open-source

W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Chcesz użyć tego skryptu na wykresie?

Wyłączenie odpowiedzialności