Very strange bug in MT4 with IBands *Live account only*

 

Be careful when using IBands values in a live account! I found a pretty serious bug in MT4 relating to IBands. It is weird in that it only surfaces when used in a Live account NOT in Demo mode.

If a period timeframe is specied for IBands then the value returned is always '0'.

Here is a repro when in a live account-

// The below doesn't work when in a live account

Print("h4lowerband= ",iBands(NULL,PERIOD_H4,20,2,0,PRICE_CLOSE,MODE_LOWER,0));

//This doesn't work either:

Print("h4lowerband= ",iBands(NULL,240,20,2,0,PRICE_CLOSE,MODE_LOWER,0));

You'll see the value 0 always returned.

If the period timeframe is left at '0' for the current chart setting, then the value will return correctly.

// The below does work when in a live account

Print("h4lowerband= ",iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,0));

Either seems to work fine from a demo account.

 

PERIOD_H4 not Period_H4 in capital letters not small

 
qjol:

PERIOD_H4 not Period_H4 in capital letters not small


my typo, in the post only... The bug still exist.
 

it's weird it works fine for me

 
qjol:

it's weird it works fine for me

Interesting. I repro'd on a live tdfx account. Meta Trader version 4, build 229.

I couldn't repro on a demo account... only on a live account.

Which build are you using?

 

226

 

Good to hear that build 226 isn't affected. Can anyone else repro this problem on build 229 when speicifying a timeframe for Ibands on a live account?

Reason: