There are a lot of ways to measure volatility (changeability). One of them is calculation of the standard deviation of returns for a certain period of time. Sometimes the current volatility on a short period of time (for example, 6 days) is correlated with volatility of a larger period (for example 100 days). This indicator calculates the correlation of a short volatility Vol_short and a long volatility Vol_long:
Standard deviation here is not that from a difference of closing prices, but from logarithms of the correlation of the current day closing price and closing price of a previous day:
where k is the period of volatility change.
The indicator uses SmoothAlgorithms.mqh library classes (must be copied to the terminal_data_folder\MQL5\Include). The use of the classes was thoroughly described in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".
This indicator was first implemented in MQL4 and published in Code Base 03.02.2008.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/773
The semaphore signal indicator with the values based on five technical indicators: LWMA, SMA, RSI, Stochastic, MACD.TrendTriggerMod
The indicator displays trend power and direction.