ProfitProgrammers

Volatility Bands

We used Marc Chaikin’s Chaikin Volatility as somewhat of a baseline for this indicator and then built on it. Like Chaikin Volatility, our indicator draws primarily upon high-low spreads to quantify a security’s volatility. It also has similarities to Keltner Channels as it uses ATR rather than standard deviations in its calculation of the different bands.

Inputs:
int ‘len0’, lookback window for fast EMA of high-low ranges.
int ‘len1’, lookback window for slow EMA of high-low ranges.
int ‘len2’, lookback window for slow EMA of closing prices.
float ‘m0’, ATR multiplier for first upper and lower volatility bands.
float ‘m1’, ATR multiplier for second upper and lower volatility bands.
float ‘m2’, ATR multiplier for third upper and lower volatility bands.
int ‘lenATR’, window length for ATR calculation.

Output: 3 Upper and Lower Volatility Bands (6 total).
1. Compute High Low Spread for current period.
hlr = (high – low)

2. Calculate Exponential Moving Average of HLR at length len0
fastEMA = ema(hlr, len0)

3. Calculate Exponential Moving average of HLR at length len1 (where len1 > len0)
slowEMA = ema(hlr, len1)

4. Get EMA of closing prices at length len2(where len2 > len1 and len1 > len0)
priceEMA = ema(close, len2)

5. Use adjusted Chaikin Volatility Formula to quantify volatility
v = (fastEMA – slowEMA) / slowEMA

6. Calculate three upper and three lower volatility bands (6 total):
ex:
upper0 = priceEMA + ((1 – cv) * (atrMult0 * atr(lenATR)))
lower0 = priceEMA – ((1 – cv) * (atrMult0 * atr(lenATR)))


One possible way to use this indicator is to enter a long position when the security’s price falls below the lowest volatility band and then exit when it crosses above the third upper band. This seems to get the best results for quick, high frequency trading. Another approach is to enter a position when the bands begin to break out from a compact state and the width between them increases.

Still tweaking the idea, so any feedback would be appreciated.

-Profit Programmers
www.profitprogrammer.com
Mã được bảo vệ
Tập lệnh này được xuất bản mã nguồn đóng và bạn có thể sử dụng một cách tự do. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ. Bạn không thể xem hoặc sửa đổi mã nguồn.
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 đồ?