Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


Standard Deviation (StdDev) - indicator for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 22
2010.01.26 11:23
2016.11.22 07:32
stddev.mq5 (5.13 KB)view

Technical indicator named Standard Deviation (StdDev) measures the market volatility.

This indicator charactrizes the scale of price changes relating to the Moving Average. Thus, if the indicator value is large, the market is volatile and the bars prices are rather dispersed relating to the moving average. If the indicator value is not large, it means that the market volatility is low and the bars prices are rather close to the moving average.

Normally, this indicator is used as a constituent of other indicators. Thus, when Bollinger Bands is calculated, the value of the symbol standard deviation is added to its Moving Average.

The market behavior represents the interchange of high trading activity and languid market. So, the indicator can be interpreted easily:

  • If its value is too low, i.e., the market is absolutely inactive, it makes sense to expect a spike soon;
  • Otherwise, if it is extremely high, it most probably means that activity will decline soon.

Standard Deviation technical indicator


StdDev (i) = SQRT (AMOUNT (j = i - N, i) / N)
AMOUNT (j = i - N, i) = SUM ((ApPRICE (j) - MA (ApPRICE , N, i)) ^ 2)


  • StdDev (i) - Standard Deviation of the current bar;
  • SQRT - square root;
  • AMOUNT(j = i - N, i) - sum of squares from j = i - N to i;
  • N - smoothing period;
  • ApPRICE (j) - the applied price of the j-th bar;
  • MA (ApPRICE (i), N, i) - any moving average of the current bar for N periods;
  • ApPRICE (i) - the applied price of the current bar.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Relative Vigor Index (RVI) Relative Vigor Index (RVI)

The main point of the Relative Vigor Index Indicator (RVI) is that on the bull market the closing price is, as a rule, higher, than the opening price.

Relative Strength Index (RSI) Relative Strength Index (RSI)

The Relative Strength Index Indicator (RSI) is a price-following oscillator that varies between 0 and 100.

Stochastic Oscillator Stochastic Oscillator

The Stochastic Oscillator compares where a security’s price closed relative to its price range over a given time period.

Ultimate Oscillator Ultimate Oscillator

The Ultimate Oscillator was developed by Larry Williams. It uses the averaging of three oscillators with different periods.