blackcat1402

[blackcat] L1 Reverse Choppiness Index

blackcat1402 Mis à jour   
The Choppiness Index is a technical indicator that is used to measure market volatility and trendiness. It is designed to help traders identify when the market is trending and when it is choppy, meaning that it is moving sideways with no clear direction. The Choppiness Index was first introduced by Australian commodity trader E.W. Dreiss in the late 1990s, and it has since become a popular tool among traders.

Today, I created a reverse version of choppiness index indicator, which uses upward direction as indicating strong trend rather than a traditional downward direction. Also, it max values are exceeding 100 compared to a traditional one. I use red color to indicate a strong trend, while yellow as sideways. Fuchsia zone are also incorporated as an indicator of sideways. One thing that you need to know: different time frames may need optimize parameters of this indicator. Finally, I'd be happy to explain more about this piece of code.

The code begins by defining two input variables: `len` and `atrLen`. `len` sets the length of the lookback period for the highest high and lowest low, while `atrLen` sets the length of the lookback period for the ATR calculation.

The `atr()` function is then used to calculate the ATR, which is a measure of volatility based on the range of price movement over a certain period of time. The `highest()` and `lowest()` functions are used to calculate the highest high and lowest low over the lookback period specified by `len`.

The `range`, `up`, and `down` variables are then calculated based on the highest high, lowest low, and closing price. The `sum()` function is used to calculate the sum of ranges over the lookback period.

Finally, the Choppiness Index is calculated using the ATR and the sum of ranges over the lookback period. The `log10()` function is used to take the logarithm of the sum divided by the lookback period, and the result is multiplied by 100 to get a percentage. The Choppiness Index is then plotted on the chart using the `plot()` function.

This code can be used directly in TradingView to plot the Choppiness Index on a chart. It can also be incorporated into custom trading strategies to help traders make more informed decisions based on market volatility and trendiness.

I hope this explanation helps! Let me know if you have any further questions.
Notes de version:
upgrade to v5

Avoid losing contact!Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?