// Standard deviation - //en.wikipedia.org/wiki/Standard_deviation // SMA = 1/n sum(X) // Std = Sqrt[1/n sum{(x-sma)^2}] = Sqrt[1/n Sum(x^2)-(1/n Sum(x))^2] double sumX = 0.0, sumX2 = 0.0; for(INDEX i=iBar+agkLength; i>iBar;){ --i; CHANGE tr = TRD(i); sumX += tr; sumX2 += tr * tr; } double sma = sumX / agkLength, std = MathSqrt(sumX2/agkLength - atr*atr);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
does any one know what formula is used in creating the mql5 standard deviation channels object OBJ_STDDEVCHANNEL and how this formula can be coded from first principles in mql5 to derive the channel values.
I think this could be a freelance opportunity for some one with this knowledge