Indicators: Volatility ratio

 

Volatility ratio:

Volatility ratio - standard deviations based

Volatility ratio

Author: Mladen Rakic

Volatility ratio
Volatility ratio
  • www.mql5.com
There is always a need to measure if the market is "quiet" or it is volatile. One of the possible way is to use standard deviations, but the issue is simple : we do not have some levels that could help us find out if the market is in a state of lower or higher volatility. This...
 

Thanks!

Can we have mt4 version?

 
Is there an MT4 version? Looks great.
 
Its a StdDev with a SMA of the same Period. Easy to rebuild in MT4
 
This is the MT4 version: https://www.mql5.com/en/code/26159
Volatility ratio
Volatility ratio
  • www.mql5.com
TraderToolEA TraderTool is a tool/panel that will help any trader to perform trades quickly and easily. The product has been developed with user-friendliness and ease of use in mind. It has the ability to manage multiple types of orders, either placed by an Expert Advisor or...
 

I love this indicator, it immediately found a place in my way of trading, but sometimes it doesn't show up in M1, M5 and even M15.Would it be possible to fix the problem?

 
Tistou:

I love this indicator, it immediately found a place in my way of trading, but sometimes it doesn't show up in M1, M5 and even M15.Would it be possible to fix the problem?

I have been testing my trading algorithm using this indicator as part of my system, I get a similar problem.

I get errors copying the volatility data for some charts, after further checking i found 0 Divide errors at the line commented out:

            double deviationAverage = m_array[i].sumd/(double)m_period;                 
//            return(deviationAverage != 0 ? m_array[i].deviation/deviationAverage : 1);
            if ((deviationAverage != 0) && (m_array[i].deviation != 0)){
               return(m_array[i].deviation/deviationAverage);            
            } else {
               return(1);             
            }

I am not sure why this occurs i tried to fix it by modifying the code as seen, but maybe mladen can assist, theoretically 0 divide errors should be impossible with this code but it still seems to happen, it may be the chart data, as it does not happen with all charts, and even the ones it happens to are only temporary.

Example charts FRA40, XAUAUD
 

Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
  • www.mql5.com
order_calc_margin - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5