OPEN-SOURCE SCRIPT

Candle Body Support/Resistance [LuxAlgo]

The Candle Body Support/Resistance indicator is a tool that provides Support/Resistance levels from high-volatility candles, a concept originally described by Steve Nison in "Beyond Candlesticks".

Users can define the candle body percentage used to set the detected support/resistance levels. Occurrences of price testing the returned levels are highlighted using user-customizable dots.

🔶 USAGE

ảnh chụp nhanh

Support/Resistance levels are drawn from volatile candles, that is candles having a body (range between opening and closing price) whose magnitude is larger than the Volatility Threshold, which is determined by the multiplicative factor of an ATR (Average True Range) using a user set length.

ảnh chụp nhanh

The level starts from the opening price +/- a percentage of the open-close range. Users can adjust the percentage of the candle body used as support/resistance levels respectively, with higher percentage values returning levels prone to get reached sooner by the price.

ảnh chụp nhanh

A test is considered valid when a wick passes through the Support/Resistance level while the closing price is not breaking it.

Two modes are included, Trailing and Historical, both affecting the displayed elements of the indicator, these are described in the sub-section below.

🔹 Historical

The Historical Mode will draw a separate line from every Volatile Candle. When this line is tested, a dot will be drawn.

ảnh chụp nhanh

In the above example, the red resistance line was tested once until a bullish volatile candle formed, which closed just below the resistance level. The resistance level was tested again, after which the newly created support level was broken quickly, and the price decreased. These levels proved helpful later, acting as resistance/support levels (illustrated by the extra manually drawn dashed white lines).

ảnh chụp nhanh

To prevent cluttering Support/Resistance, lines will be deleted when the line is mitigated and hasn't been tested.

When a Support/Resistance line reaches its Maximum Line Length, it will also be deleted when it has not been tested.

🔹 Trailing

When a new volatile candle of the same type (bullish/bearish) appears while the Support/Resistance isn't broken, this line will be updated with the values of the new volatile candle. This creates a trailing line and a less cluttered chart.

Unlike the Historical mode, a line will not be deleted after a while or when it is mitigated. Instead, the line won't be updated anymore. A new line will start from the next found volatile candle.

ảnh chụp nhanh

Using the same situation as the Historical Mode example, we can note the future significance of old support/resistance levels (illustrated by the extra manually drawn dashed white lines).

The user can switch between these 2 modes, each offering a unique perspective on the market. This provides a more in-depth examination of the market, enhancing the user's trading analysis.

ảnh chụp nhanh

Using a copy of our indicator while using both modes can also be helpful.

ảnh chụp nhanh

🔶 DETAILS

The Support level is the opening price of a bullish volatile candle plus a user-set percentage of the candle's body, while the Resistance level is the opening price of a bearish volatile candle minus a percentage of the candle's body.

ảnh chụp nhanh

The following example illustrates the ATR with the multiplicative factor (Volatility Threshold) where the body of Volatile candles exceeds the ATR limits. Changing the Volatility Threshold and ATR length gives users extra flexibility to adjust to their needs.

ảnh chụp nhanh

🔹 Max Line Length

ảnh chụp nhanh

When using the Historical Mode and the duration of a displayed level reaches the user-set Max Line Length value, the level will return to the last test or be deleted when it has not been tested.

🔶 SETTINGS

  • Display Mode: Display mode of the indicator.
  • Support %: Sets the distance of the Support Line from the opening price relative to the candle body.
  • Resistance %: Sets the distance of the Resistance Line from the opening price relative to the candle body.


🔹 Filter

  • Length ATR: Amount of bars for the calculation of the Average True Range.
  • Volatility Threshold: multiplicative factor of ATR.
  • Max Line Length: Maximum allowed duration/length (in bars) of a Support/Resistance level.
candleCandlestick analysisluxalgosignalssupportSupport and Resistancesupportandresitance

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