Trendoscope

Relative Bandwidth Filter

This is a very simple script which can be used as measure to define your trading zones based on volatility.

Concept
This script tries to identify the area of low and high volatility based on comparison between Bandwidth of higher length and ATR of lower length.

Relative Bandwidth = Bandwidth / ATR

Bandwidth can be based on either Bollinger Band, Keltner Channel or Donchian Channel. Length of the bandwidth need to be ideally higher.
ATR is calculated using built in ATR method and ATR length need to be ideally lower than that used for calculating Bandwidth.

Once we got Relative Bandwidth, the next step is to apply Bollinger Band on this to measure how relatively high/low this value is.

Overall - If relative bandwidth is higher, then volatility is comparatively low. If relative bandwidth is lower, then volatility is comparatively high.

Usage
This can be used with your own strategy to filter out your non-trading zones based on volatility. Script plots a variable called "Signal" - which is not shown on chart pane. But, it is available in the data window. This can be used in another script as external input and apply logic.

Signal values can be
  • 1 : Allow only Long
  • -1 : Allow only short
  • 0 : Do not allow any trades
  • 2 : Allow both Long and Short


Mã nguồn mở

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

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

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

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