Download MetaTrader 5

Bollinger Bands Mismatch

To add comments, please log in or register
Have you published a program in the Market? Place it in your blog as well - the widget will help!
Henrique Vilela
1233
Henrique Vilela 2013.12.03 22:52 

I'm trying to use iBands to retrieve the Bollinger Bands lower and upper values but for some reason the data does not march the visual chart (created by the same iBands function call).

Sometimes it's above, sometimes it's below... doesn't seams to follow a pattern.

Any Advice?

double upper = iBands(NULL, 0, 20, 2, 0, MODE_CLOSE, MODE_UPPER, 1);
double lower = iBands(NULL, 0, 20, 2, 0, MODE_CLOSE, MODE_LOWER, 1);
ObjectSet("Upper", OBJPROP_PRICE1, upper);
ObjectSet("Lower", OBJPROP_PRICE1, lower);   
Henrique Vilela
1233
Henrique Vilela 2013.12.03 23:00  
hvilela:

I'm trying to use iBands to retrieve the Bollinger Bands lower and upper values but for some reason the data does not march the visual chart (created by the same iBands function call).

Sometimes it's above, sometimes it's below... doesn't seams to follow a pattern.

Any Advice?

I just realized that there's a message at journal that says:

2013.12.03 20:54:43     BollingerBands inputs: bands_period=10; bands_derivation=3; 

When I use this parameters, it matches.

Why would it use 10 and 3 instead of 20 and 2 (that i'm passing as parameter)?

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.03 23:13  
hvilela:

I just realized that there's a message at journal that says:

When I use this parameters, it matches.

Why would it use 10 and 3 instead of 20 and 2 (that i'm passing as parameter)?

I'm guessing you also have the Bollinger Bands indicator attached to your chart ? set to period = 10 and derivation = 3 ?
whroeder1
14528
whroeder1 2013.12.03 23:36  
RTFM
double upper = iBands(NULL,    0,                   20,            2,            0,          MODE_CLOSE,  MODE_UPPER,      1);
double iBands(  string symbol, int timeframe, int period, int deviation, int bands_shift, int applied_price, int mode, int shift
To add comments, please log in or register