OPEN-SOURCE SCRIPT

Colored Directional Movement and Bollinger Band's Cloud by DGT

מעודכן
This study combines Bollinger Bands, one of the most popular technical analysis indicators on the market, and Directional Movement (DMI), which is another quite valuable technical analysis indicator.

Bollinger Bands used in conjunction with Directional Movement (DMI) may help getting a better understanding of the ever changing landscape of the market and perform more advanced technical analysis

Here are details of the concept applied


1- Plots Bollinger Band’s (BB) Cloud colored based on Bollinger Band Width (BBW) Indicator’s value

Definition

Bollinger Bands (created by John Bollinger ) are a way to measure volatility . As volatility increases, the wider the bands become and similarly as volatility decreases, the gap between bands narrows

Bollinger Bands, in widely used approach, consist of a band of three lines. Likewise common usage In this study a band of five lines is implemented
The line in the middle is a Simple Moving Average (SMA) set to a period of 20 bars (the most popular usage). The SMA then serves as a base for the Upper and Lower Bands. The Upper and Lower Bands are used as a way to measure volatility by observing the relationship between the Bands and price. the Upper and Lower Bands in this study are set to two and three standard deviations (widely used form is only two standard deviations) away from the SMA (The Middle Line), hence there are two Upper Bands and two Lower Bands. The background between two Upper Bands is filled with a green color and the background between two Lower Bands is filled with a red color. In this we have obtained Bollinger Band’s (BB) Clouds (Upper Cloud and Lower Cloud)

Additionally the intensity of the color of the background is calculated with Bollinger Bands Width ( BBW ), which is a technical analysis indicator derived from the standard Bollinger Bands indicator. Bollinger Bands Width, quantitatively measures the width between the Upper and Lower Bands. In this study the intensity of the color of the background is increased if BBW value is greater than %25

What to look for

Price Actions : Prices are almost always within the bands especially at this study the bands of three standard deviations away from the SMA. Price touching or breaking the BB Clouds could be considered as buying or selling opportunity. However this is not always the case, there are exceptions such as Walking the Bands. “Walking the Bands” can occur in either a strong uptrend or a strong downtrend. During a strong trend, there may be repeated instances of price touching or breaking through the BB Clouds. Each time that this occurs, it is not a signal, it is a result of the overall strength of the move. In this study in order to get a better understanding of the trend and add ability to perform some advanced technical analysis Directional Movement Indicator (DMI) is added to be used in conjunction with Bollinger Bands.

Cycling Between Expansion and Contraction : One of the most well-known theories in regards to Bollinger Bands is that volatility typically fluctuates between periods of expansion (Bands Widening : surge in volatility and price breaks through the BB Cloud) and contraction (Bands Narrowing : low volatility and price is moving relatively sideways). Using Bollinger Bands in conjunction with Bollinger Bands Width may help identifying beginning of a new directional trend which can result in some nice buying or selling signals. Of course the trader should always use caution


2- Plots Colored Directional Movement Line

Definition

Directional Movement (DMI) (created by J. Welles Wilder ) is actually a collection of three separate indicators combined into one. Directional Movement consists of the Average Directional Index (ADX) , Plus Directional Indicator (+D I) and Minus Directional Indicator (-D I) . ADX's purposes is to define whether or not there is a trend present. It does not take direction into account at all. The other two indicators (+DI and -DI) are used to compliment the ADX. They serve the purpose of determining trend direction. By combining all three, a technical analyst has a way of determining and measuring a trend's strength as well as its direction.

This study combines all three lines in a single colored shapes series plotted on the top of the price chart indicating the trend strength with different colors and its direction with triangle up and down shapes.

What to look for

Trend Strength : Analyzing trend strength is the most basic use for the DMI. Wilder believed that a DMI reading above 25 indicated a strong trend, while a reading below 20 indicated a weak or non-existent trend

Crosses : DI Crossovers are the significant trading signal generated by the DMI

With this study
A Strong Trend is assumed when ADX >= 25
Bullish Trend is defined as (+D I > -DI ) and (ADX >= 25), which is plotted as green triangle up shape on top of the price chart
Bearish Trend is defined as (+D I < -DI ) and (ADX >= 25), which is plotted as red triangle down shape on top of the price chart
Week Trend is assumed when 17< ADX < 25, which is plotted as black triangles up or down shape, depending on +DI-DI values, on top of the price chart
Non-Existent Trend is assumed when ADX < 17, which is plotted as yellow triangles up or down shape, depending on +DI-DI values, on top of the price chart

Additionally intensity of the colors used in all cases above are defined by comparing ADX’s current value with its previous value

Summary of the Study:
Even more simplified and visually enhanced DMI drawing comparing to its classical usage (may require a bit practice to get used to it)
As said previously, to get a better understanding of the trend and add ability to perform some advanced technical analysis Directional Movement Indicator (DMI) is used in conjunction with Bollinger Bands.

PS: Analysis and tests are performed with high volatile Cryptocurrency Market

Source of References : definitions provided herein are gathered from TradingView’s knowledgebase/library

Disclaimer: The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd tradingview user liable for any possible claim for damages arising from any decision you make based on use of the script
הערות שחרור
Configurable Inputs added, so the users can see and edit inputs on the Format Object dialog of this study

Secondly, value added enhancement performed by adding Volume Based Colored Bars indicator created by Kıvaç ÖZBİLGİÇ.
Special thanks to Kıvaç ÖZBİLGİÇ for allowing me to use this indicator and his immediate reply to my request of permission to use his indicator.

Volume Based Colored Bars colors the bars into volume weighted signals increasing the visibility of the Volume changes. Intensity of the colors of the bars varies according to average value of the volume for given length of bars (default value set to 30 bars)
הערות שחרור
reorganized the script structure for more readability and a small enhecment
הערות שחרור
label added :
displaying the trend strength and direction
displaying adx and di+/di- values
displaying adx's momentum (grawing or falling)
where tooltip label describes "howto read colored dmi line"
הערות שחרור
spelling correction
הערות שחרור
made study customizable

added additional level for bollinger bands

added volatility colored price / moving average ratio line : for details please check Price Distance to its MA by DGT and PVTvX by DGT study
הערות שחרור
more customizations

middle line and standard deviation bands of the bollinger bands are now customizable with ability to select different moving average types, such as DEMA, HMA, WMA besides standard SMA
הערות שחרור
Pine v5 update plus slight aesthetic changes
Bollinger Bands Width (BBW)DGTdiminusdiplusdistanceHMAMoving AveragesstrengthTrend AnalysistrendstrengthVolatility

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור