Type/to search

Volatility Range Breakout Trading Strategy

Cryptocurrency
Created: 2023-09-21 20:38:29
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This strategy generates trading signals based on the historical volatility range of the price. It calculates the difference between the highest and lowest prices over a certain period, and forms a volatility range using moving averages. Trading signals are triggered when the price breaks through the upper or lower bands of the range. It belongs to the trend-following breakout strategies.

Strategy Logic

The core indicator is the historical volatility of the price. The specific calculation is:

  1. Calculate the difference between the highest and lowest prices over the past N bars, called HL

  2. Calculate the average of the highest and lowest prices over N bars, avg(H, L)

  3. Volatility = HL / avg(H, L)

Where N is the "Volatility Length" parameter.

After getting the volatility, the bands are calculated as:

Upper Band = Current close + Current close * Volatility

Lower Band = Current close - Current close * Volatility

The bands are then smoothed by WMA with period set as "Average Length".

When price breaks above the upper band, go long. When price breaks below the lower band, go short.

Exit signals are defined by "Exit Type":

  1. If Exit Type is Volatility MA, exit when price crosses back below WMA.

  2. If Exit Type is Range Crossover, exit when price crosses back below the bands.

Advantages

  • Volatility catches trending moves well
  • WMA makes the bands more stable and reliable
  • Breakout signals catch trend turns timely
  • Exits based on WMA/bands cut losses fast
  • Much room for parameter tuning for different markets

Risks

  • Breakouts may whipsaw with price reversing
  • Risks large losses at trend reversals
  • WMA sometimes lags in detecting trend turns
  • Parameter optimization not easy, needs much trial and error
  • Larger drawdowns, need good risk management

Risks can be reduced by:

  • Optimizing parameters for more reliable bands
  • Adding other indicators to avoid whipsaws
  • Smaller sizes and better risk management
  • Considering re-entries

Optimization Directions

The strategy can be improved by:

  1. Parameter tuning

Test different Length values to find optimal combinations.

  1. Adding other indicators

For example, when price breaks above upper band, check if MACD also golden crosses.

  1. Better stop loss

Optimizing to trailing stops instead of simple range break stops.

  1. Re-entries

Set re-entry rules to catch trends again after stops.

  1. Position sizing

Dynamically adjust sizes based on market volatility.

Summary

This strategy works well for trending markets in general by using volatility-based bands to gauge trend strength and WMA to form reliable trading ranges for breakout signals. But some issues exist like lagging trend detection, improvable stops, etc. Extensive backtesting and optimization is needed using real data to adjust parameters and rules, reducing false signals and making it robust across different market conditions. Also strict risk management is key for long-term profitability.

Source
Pine
/*backtest
start: 2023-09-13 00:00:00
end: 2023-09-20 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © wbburgin

//@version=5
Strategy parameters
Strategy parameters
Average Length
Volatility Length
Volatility Source
Exit Source
Exit Type
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)