The Volatility Cycle Breakout indicator draws range boxes overlaid on the price chart. The upper and lower side of the boxes are made from recent Fractals. New boxes will be drawn only if the volatility is weak and if the new fractals discovered are far enough from the current upper and lower ones.
The volatility cycle is extracted from Bollinger Bands (InpBandsPeriod=18 is the bands period). Original indicator is here: Volatility Cycle
Fractals lookback periods can be adapted to catch new fractals far in the history or near of the current price (cp=10).
The “change” variable is the percent variation needed to change the support and resistance levels of the boxes (0.1% seems to work fine for intraday timeframes on forex pairs for instance). This setting is important because it will reduce the noises of “moving boxes” each time new Fractals are discovered, specially when price is ranging. It results perfect range boxes on price to play mean reversion strategy when price is not moving enough to make real breakout.
Original concept (modified since) come from a topic in French forum.
All ideas are welcome and could result in new good indicators, don’t hesitate to post them in forums!
//PRC_Volatility Cycle Breakout | indicator
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//InpBandsPeriod=18 // Period
//Smooth=2 // Smoothness
//cp=10 // Fractals periods
//change=0.1 // Percent change to modify the upper/lower channel
//--- end of parameters
StdDev = std[InpBandsPeriod](close)
highindex = highest[InpBandsPeriod](StdDev)
lowindex = lowest[InpBandsPeriod](StdDev)
if barindex>InpBandsPeriod then
VolDer = (StdDev-highindex)/(highindex-lowindex)
VolSmooth = average[Smooth](VolDer)
if VolSmooth>0 then
VolSmooth = 0
elsif VolSmooth<-1.0 then
VolSmooth = -1.0
if high[cp] >= highest[2*cp+1](high) then
LH = 1
LH = 0
if low[cp] <= lowest[2*cp+1](low) then
LL = -1
LL = 0
if LH = 1 then
TOPy = high[cp]
if LL = -1 then
BOTy = low[cp]
if VolSmooth = -1.0 then //no volatility
if abs(TOPy-upperchannel)/close>change/100 then
upperchannel = TOPy
if abs(BOTy-lowerchannel)/close>change/100 then
lowerchannel = BOTy
RETURN upperchannel coloured(100,150,100) style(dottedline) as "upper channel", lowerchannel coloured(150,100,100) style(dottedline) as "lower channel"
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :