Directional Volatility

Category: Indicators By: Nicolas Created: November 27, 2018, 10:15 AM
November 27, 2018, 10:15 AM
Indicators
4 Comments

Directional Volatility indicator. The indicator displays two volatility lines – bullish and bearish ones.

It has two configurable parameters:

  • Period – calculation period
  • Deviation – deviation

It is calculated with the standard deviation from a mean of the last X Period, made of distance between the last Close with the High/Low depending of the direction (short or long curves).

Converted from a mq5 indicator by a request in the English forum.

//PRC_DirectionalVolatility | indicator
//27.11.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- settings 
Period= 20
Deviation= 2
// --- end of settings 

ShortS = Close[1] - Low
ShortMA = average[Period](ShortS)
ShortDev = Std[Period](ShortMA)

LongS = High - Close[1]
LongMA = average[Period](LongS)
LongDev = Std[Period](LongMA)

Short = ShortMA + Deviation * ShortDev
Long  = LongMA  + Deviation * LongDev

return Short coloured(255,0,0), Long coloured(0,255,0)

 

Download
Filename: PRC_DirectionalVolatility.itf
Downloads: 407
Nicolas Master
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

Logo Logo
Loading...