Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | Volatility2Step

Real author:

Eva Ruft

A simple indicator that calculates rounded volatility of a financial asset. Volatility is calculated in points based on the maximum and minimum prices.

The volatility is calculated using a simple MA as the sum of the maximum prices for the averaging period minus the sum of minimal prices for the same period. The resulting value is converted into points and rounded according to the coordinate grid step defined by the StartLevel and LevelsStep input values.

Inputs:

//+-----------------------------------+  //|   INDICATOR INPUT PARAMETERS      |  //+-----------------------------------+  input  ENUM_MA_METHOD   MAType=MODE_SMA;           // smoothing method  input uint              VolatilityPeriod=5;        // indicator period  input int               Shift=0;                   // horizontal indicator shift in bars  input uint              LevelsTotal=20;            // number of levels  input uint              StartLevel=100;            // initial level  input uint              LevelsStep=100;            // distance between levels  input color             LevelsColor=clrDarkOrange; // color of levels  

MetaTrader Experts, Indicators, Scripts and Libraries

Fig. 1. Volatility2Step indicator

22963