OPEN-SOURCE SCRIPT

Donchian MA Bands [LuxAlgo]

The Donchian MA Bands script is a complete trend indicator derived from the popular Donchian channel indicator as well as various customizable moving averages to estimate trend direction and build support/resistance levels & zones.

🔶 USAGE

ảnh chụp nhanh

The indicator outputs various elements, the main ones being a lower dynamic zone (blue by default), an upper dynamic zone (in orange by default), and one support and resistance level/zones (red/green by default).

A prominent lower zone is indicative of an uptrend, while a prominent upper zone is indicative of a downtrend. These zones can be used as support/resistance as well.

Support/resistance zones and levels can be used using a breakout methodology or to determine price bounced if a level was tested multiple times.

The indicator contains various modes affecting the output of the indicator, described below.

🔹Clouds

ảnh chụp nhanh

Clouds return one upper/lower dynamic zone and look/act similarly to a trailing stop. Price over the lower zone is indicative of an uptrend, and price under the upper zone is indicative of a downtrend.

🔹Upper Band

ảnh chụp nhanh

The upper band mode returns a dynamic zone closer to prices during an uptrend, and farther away during a downtrend.

This band can act as a support during uptrends.

🔹Lower Band

ảnh chụp nhanh

The lower band mode returns a dynamic zone closer to prices during an uptrend, and farther away during a downtrend.

This band can act as a resistance during downtrends.

🔹Bands

ảnh chụp nhanh

Bands return both upper and lower zones, the zones are more apparent depending on the price trend direction, with uptrends being indicated by a more visible lower zone, and downtrends being indicated by a more visible upper zone.

Breakout dots are highlighted when price breakout the indicator displayed extremities, and can be indicative of a confirmed trend reversal.

ảnh chụp nhanh

These breakouts can be more effective for trend following during trending markets. Ranging markets might return breakouts highlighting the top/bottom.

🔶 DETAILS

The core of this script is the highest / lowest mean average (MA) value for a given number of bars back (Donchian lines).

This is repeated a few times with the obtained values.
ảnh chụp nhanh

When Bands are chosen (Style) this will be repeated 1 more time.
ảnh chụp nhanh

The type of mean average can be customized (Type MA), as well as the number of bars back (Length).

Depending on the choice of bands (Style) the script will focus on certain area's of interest.
ảnh chụp nhanh
ảnh chụp nhanh

When the option Clouds, Upper band or Lower band is chosen, an extra feature, support/resistance (S/R), will be shown.
These color-filled areas are visible when there is a difference between the 2nd and 3rd highest/lowest values.
The lines/areas can be used for stop loss, entry, exit,...
You can set the type of MA and Length separately (Settings -> S/R).
If you don't need this feature, simply set Type (Settings -> S/R) -> NONE
ảnh chụp nhanh
The shape sometimes resembles triangles, indicating a potential direction
ảnh chụp nhanh

Default the average of the highest and lowest values is plotted (Style -> Mid Donchian)
This can act as potential support/resistance or visualization of the trend, the mean average is not plotted but can be (Style -> MA)

ảnh chụp nhanh

🔹 Note

When the option Bands is chosen, an indication is plotted when the closing price breaks above the highest band or breaks below the lower band. This isn't necessarily a buy/sell signal, it is merely a signal that these lines are broken.

Users should decide on their own how they use the bands/lines/areas as entry, exit, trailing stop, stop loss, profit taking,...

🔶 SETTINGS

🔹 Bands

  • Style: Clouds (default), Upper band, Lower band, Bands
  • Type MA: choose between SMA, EMA, RMA, HullMA, WMA, VWMA (default), DEMA, TEMA, NONE (off)
  • Length: Length of moving average and Donchian calculations (default 20)
  • Colour Bands


🔹 S/R (Support/Resistance, visible with Clouds, Upper band or Lower band)

  • Type MA: choose between SMA, EMA, RMA, HullMA, WMA, VWMA (default), DEMA, TEMA, NONE (off)
  • Length: Length of moving average and Donchian calculations (default 20)
  • Colour S/R
bandsBands and Channelscloudsluxalgomoving_averageMoving Averagessupportandresistancezoneszones

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?


Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Ngoài ra, trên:

Thông báo miễn trừ trách nhiệm