Nicolas

Volatility breakout indicator

Category: Indicators By: Nicolas Created: March 15, 2017, 8:50 AM
March 15, 2017, 8:50 AM
Indicators
10 Comments
Volatility breakout indicator

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
//03.10.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

//--- parameters
//InpBandsPeriod=18      // Period
//Smooth=2               // Smoothness
//cp=10                  // Fractals periods
//change=0.1             // Percent change to modify the upper/lower channel
//--- end of parameters

//Cycle
StdDev = std[InpBandsPeriod](close)
highindex = highest[InpBandsPeriod](StdDev)[1]
lowindex = lowest[InpBandsPeriod](StdDev)[1]

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
 endif
endif

//fractals
if high[cp] >= highest[2*cp+1](high) then
 LH = 1
else
 LH = 0
endif

if low[cp] <= lowest[2*cp+1](low)  then
 LL = -1
else
 LL = 0
endif

if LH = 1 then
 TOPy = high[cp]
endif

if LL = -1 then
 BOTy = low[cp]
endif

//channel
if VolSmooth = -1.0 then //no volatility
 if abs(TOPy-upperchannel)/close>change/100 then 
  upperchannel = TOPy
 endif
 if abs(BOTy-lowerchannel)/close>change/100 then 
  lowerchannel = BOTy
 endif
endif

RETURN upperchannel coloured(100,150,100) style(dottedline) as "upper channel", lowerchannel coloured(150,100,100) style(dottedline) as "lower channel"

 

Download
Filename: usdjpy-breakout.png
Downloads: 140
Download
Filename: eurusd-breakout-boxes.png
Downloads: 175
Download
Filename: PRC_Volatility-Cycle-Breakout-1.itf
Downloads: 604
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

phanz
5 years ago
#

Hi Nicolas, this is an interesting strategy. For long position, I assume entry when prices crosses over the upper band. For exit, do you recommend prices crosses under the upper band, or prices crosses under the lower band? What's your thoughts?

Francesco
9 years ago
#

Thank you Abz!

Abz
Abz
10 years ago
#

 hi , you need to add the indicator from the "price" menu in chart

Francesco78
10 years ago
#

Thank you Nicolas, 

I have copied your nice indicator, but it shows in the lower part of the chart instead of overlapping the price chart.

What am I missing?

Many thanks

Francesco 

ghary
10 years ago
#

Bonjour 

c'est fait j'ai mis la demande dans le forum français pro screener, c'est bien la qu'il fallait ouvrir le tropic ? 

 

Merci encore pour le travail. 

 

ghary
10 years ago
#

Bonjour Nicolas 

l'idee du screener serait de sortir les actifs dont le prix se situerait à l'intérieur de la boxe lors de la baisse de la volatilité afin de préparer la sortie à la hausse ou à la baisse. 

Je ne sais pas si cela est assez clair. 

Nicolas
10 years ago
#

Oui bien sûr, il faudrait créer une demande spécifique dans le forum dédié à ProBuilder, merci.

Marius
10 years ago
#

Hi Nicolas,

thanks a lot for you contribution here. I never learned scripting, so I am dependend on guys like you who share their work, so thanks again. I would like to know if its´complicated to code something similar to Bollinger Bands, but formed out of two moving averages. It would be great if the colour of the sma or ema "cloud" could change, once the moving averages cross. I am a long time dreamer of such a cloud in the price field, where I can  chose  ema or sma and the number of them (20,50,34, whatever). Or does such indicator already exist in PRT? I searched a lot but could not find anything.

Nicolas
10 years ago
#

Hi Marius, for new indicator code request, please use the ProBuilder forum instead! : https://www.prorealcode.com/forum/prorealtime-english-forum/probuilder-support/

Thanks a lot.

ghary
10 years ago
#

Bonjour,

Bravo Nicolas pour l'indicateur, est il possible d'en sortir un screener ?

Merci

ProRealCode ProRealCode
Loading...