Bug? Build 202

 
Hi,

I've discovered a possible problem with the Envelopes indicator which I hope you can help me with. I've created a quick test Expert using the following code:

int start()
{

// Envelopes
double upper = iEnvelopes(NULL, 0, 20, MODE_SMA, 0, MODE_CLOSE, 0.15, MODE_UPPER, 1);
double lower = iEnvelopes(NULL, 0, 20, MODE_SMA, 0, MODE_CLOSE, 0.15, MODE_LOWER, 1);
return(0);
}

If I run this expert in the stratagy tester and then press the "Open chart" button, the envelopes are displayed but the actual values of the envelopes appear to be incorrect by around 10 points on the EURUSD chart. This can be seen by then manually adding the Envelopes indicator (with the same parameters as the code) to that same chart - the approximate 10 point difference can then be seen.
 
Having played a bit more, I'm also getting this problem with the MA (iMA) function.
 
Please do not mix parameters - MODE_CLOSE and PRICE_CLOSE. You must use PRICE_CLOSE value for the "applied price" parameter
 
Hi Slawa,

God, what a dumb mistake! Thanks for pointing it out. I'll retreat with my tail between my legs...


Cheers,

Coen
Reason: