OPEN-SOURCE SCRIPT

All-in-one CPR indicator

Introduction and Acknowledgement:
The script is basically a mashup script and provides a combined functionality of various indicators. I'll explain the usefulness and the optimal usage of the script after giving the credits where it is due. A CPR indicator for visually identifying the trend along with the strength of the trend is NOT available in the public library of TradingView. Hence, the need of this indicator.

The credit of creating the original indicators remain unknown to me but I would like to acknowledge the authors whose formulae and codes I have used for creating this mashup indicator.
- Frank Ochoa
- Guruprasad Meduri
- Rafael Zioni
- Stoked Stocks
- Pine team for default indicators

The prime focus of the script is identifying and simplifying the 2 main aspects of a trend:
1. Direction / Underlying trend
2. Strength of the trend

Flaws in traditional CPR:
Some may see this as a flaw, some may not. So take my opinion with a grain of salt. In general, the traditional CPR indicator is used to plot just support and resistance levels, and the trend identification is purely discretionary. In addition to this, there is no way to assess the strength of the move without using a dedicated volumed based indicator. This causes amateur traders to take counter trades to the market direction.

What is the need of this hybrid indicator?
A CPR indicator that also aids in visually identifying the trend and the strength of the trend with respect to the price action in NOT available in the public library of TradingView. The traditional CPR can be used to assess the rough direction of the market but if it combined with the Hull ribbon, the probability of identifying the trend increases manifold. Hence, I decided to create this mashup indicator.

In addition to the basic CPR pivots, the script provides the functionality of the following indicators:

1. HMA based trend ribbons with auto buy/sell signals
2. Volatility based bands - Bollinger bands, Keltner channel, Donchian channel, envelope.
3. Coloured volume candles to determine the strength of the trend
4. CPR with daily, weekly, and monthly levels
5. Previous day high/low
6. Tomorrow CPR
7. 3 Simple moving averages
8. Volume Weighted Average Price (VWAP)

Correct usage of the indicator:
The optimal usage of the indicators consists of mainly 2 parts:
1. Identification of the trend using the combination of CPR and Hull ribbon
2. Determining the strength of the trend

How to identify the trend?
In general, when the price is above CPR it is considered a bullish trend. Also, when the price is above the Hull ribbon, it is considered bullish. Reverse is true for a bearish trend. Combining the traditional CPR logic with the Hull trend ribbon, we can conclude that:
1. Bullish trend = Price above CPR and above the Hull ribbon
2. Bearish trend = Price below CPR and below the Hull ribbon

If the Hull ribbon is showing a zig-zag move, the trend will be sideways. Also, the time frame of the Hull ribbon can be defined as per the need of the user.

Exhibit: Identification of a bullish trend
snapshot

Exhibit: Identification of a bullish trend with a contra move (pullback)
snapshot

Exhibit: Identification of a bearish trend
snapshot

Exhibit: Identification of a bearish trend with a contra move (pullback)
snapshot

How to determine the strength of the trend?
1. Strong trend = The dark coloured candles represent volume more than 150% of the look back period. For instance
2. Moderate trend = The bright coloured candles represent volume between 50-150%.
3. Neutral trend = The Grey coloured candles represent a weak trend where the volume is less than 50%.

Exhibit: Identification of a strong bearish trend along with the trend direction
snapshot

Exhibit: Identification of a strong bullish trend using only coloured candles
snapshot

All the other indicators including the SMA, VWAP, Bollinger bands, Keltner channels, etc. can be used as per the taste of the trader.

Thanks for reading! I hope you find this indicator useful.

Happy learning. Cheers!
Rajat Kumar Singh (johntradingwick)
Community Manager (India), TradingView
CPRcprstrategyTrend AnalysisVolume Indicator

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Rajat Kumar Singh,
B.Tech (Delhi Technological University)
Global Community Manager, TradingView

✅ Telegram: t.me/johntradingwick
✅ Blog: tradingwick.in/
✅ Amorella: amorella.in/
Also on:

Disclaimer