Cyclical Pattern of Volatility

It is possible to look at how the Standard Deviation and Average True Range of a currency changes throughout the day using the following custom indicators.   They have not been designed to be efficient, instead I have concentrated on simplicity to demonstrate a point.

Indicator:  ATR_AverageAndBands
Indicator: StdDev_AverageAndBands
Indicator:  Indicator_ATRBands

The following charts show the value of the ATR indicator, its average and 2 standard deviation bands.   For the 1 hour timeframe, the averaging period for the ATR is set to 24 and the number of points used to calculate the ATR is set to 5,10 and 15.   For the 15 minute timeframe, the inputs are scaled accordingly, i.e. 96 for the number of points, 20, 40 and 60 for the ATR calculation:

EURGBP – 1hr, ATR has a cyclical pattern roughly around 1 day.

GBPUSD – 15min, ATR has a cyclical pattern, roughly around 1 day.

I attempted to perform a similar analysis using the standard deviation.   This could potentially have some benefits when looking for things such as a Bollinger Band squeeze.   An image of the 1 hour EURGBP graph is shown below.   It still has a cyclical nature to it, but is is much more choppy than the ATR.

 

EURGBP – 1hr, StdDev cyclical pattern around roughly 1 day, it is more choppy than the ATR.

I wanted to be able to incorporate these volatility features into my algorithms to see if certain algorithms perform better in high or low volatility conditions.   Due to the nature of these indicators, I did not want to include lots of inputs for the ATR, Averaging period, Band Multiplier etc.   Instead, I decided to standardise the averaging period around 1 day (24 periods for a 1 hour chart, 96 for a 15 minute chart etc).   It is my opinion that the ATR measured over 10 periods on the 1 hour chart seemed more appealing.

An enumeration is used to define if the ATR is below the lower band, within the lower band, within the upper band or above the upper band.   It can also be used to find candles where the ATR switches from being above the upper band to below the upper band etc.   Please see the following images:

The functions and enumerations used to measure this are included below:

Include File:  Inc_CyclicalFunctions
Script: Script_TestCyclicalFunctions

Add a Comment