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 4 Indicator | Variance

Welford's method for computing variance (published here : Variance - Welford's Method) is using single pass method for calculation, but it is still using a loop.

This method is avoiding loops after initial values are set up and that makes it much faster and suitable for usage where speed of execution is a must.

PS: if you compare it to Welford's method, there will be a difference. That is coming from a fact that Welford's method is using sample correction, while this method is not - the difference is small, and if you are used to using built in indicators using any sort of standard deviation (apart from std, Bollinger bands, ...)  then compare it to this one, but if you are calculating values that are ranging very much (some values are very different that the standard sample values) then use Welford's method

MetaTrader Experts, Indicators, Scripts and Libraries

MetaTrader Experts, Indicators, Scripts and Libraries

25691