Indicators: Bollinger Bands ® - page 2

 
Rodolfo Andrade #:

Hello, does anyone know how the Bollinger Bands level lines are calculated in Metatrader, please?
I need these values to use in an EA but I don't know how to get to them.
The print below is of a standard configuration. Period 20, Offsets 2, Offset 0 applied to closing price.

And the levels I put +2 (upper white line) and -2 (lower white line).

Guys, I've figured it out. For those who are interested, here's how it works: The level is the displacement of the bands vertically by a factor that is multiplied by the original formula (Deviations * Standard Deviation), so the final formula looks like this:
Upper Band = SMA + (Standard Deviation * Deviations)

Lower Band = SMA - (Standard Deviation * Deviations)
The levels come in as a second multiplier, so it looks like this:

Upper Band = SMA + (Standard Deviation * Deviations * Level)

Lower Band = SMA - (Standard Deviation * Deviations * Level)
So in my case a practical way to get this line in my EA is to plot two Bollinger Bands, one with Deviations of 2 and the other with Deviations of 4, i.e. Deviations * Levels.