Donchian Channel Trend Intensity [DW]

This is an experimental study designed to analyze trend intensity using two Donchian Channels .
The DCTI curve is calculated by comparing the differences between Donchian highs and lows over a major an minor period, and expressing them as a positive and negative percentage.
The curve is then smoothed with an exponential moving average to provide a signal line.

Custom bar colors included with two coloring methods to choose from.
Release Notes: Updates:

Cleaned up the code. Condensed the operations into a function.

Bar color selection is now an easy to use dropdown menu.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
For my full list of premium tools, check the blog:

Reach out on Telegram:


This repaints
DonovanWall jezmagdirila
@jezmagdirila, How so? The indicator has no problematic functions or variables within it that would cause repainting.

One way you can validate whether or not a script repaints is by trying to set up an alert on it. If the indicator does indeed repaint, you'll receive a warning dialogue about it from TV before creating the alert.

However, no such dialogue pops up when setting up alerts involving this script.

If you're referring to the fact that the values on the current bar are not certain until closed, then yes. That form of "repainting" happens on all charts because price chart values are updated on an intra-bar basis, then finalized upon close.

If you're referring to the indicator rewriting data on historical bars, it does not.

If, by some chance, you have some evidence of repainting in this script, please forward me some screenshots and details so I can troubleshoot the issue and report a bug to the Pine team if necessary.
jezmagdirila DonovanWall
@DonovanWall, If you go to the 1 minute charts with this indicator, you'll see that previous candles changes, to fit the future price.
DonovanWall jezmagdirila
@jezmagdirila, I still don't know what you mean. I just spent 30 minutes looking at this on EURUSD 1m, and I saw no such repainting.

As I said before, if you have some evidence of repainting, please send details and screenshots so we can troubleshoot the issue.
+1 Reply
how to find the angle of inclination?
Hi great script.. But there's also repaint on candle.. How to prevent this ?