Hi,
Is it me or have I discovered a bug with the CCI calculation in MetaTrader 4?
I'm using this EA code...
which displays the CCI result for both the Day and Hour periods.
When I compare the result with the actual periods selected within MetaTrader I get two different results. Why? Which is correct? If my code is wrong where is the error? Have a made a stupid mistake?
Here's screenshots of the CCI indicator using the Day and Hour periods.
Day Period
Hour Period
Thanks in advance for your help.
Neither an MT4 bug or a bug in your code. It's you :-)
day = iCCI(NULL,PERIOD_D1,14,PRICE_CLOSE,1);
That's the previous candle.
Neither an MT4 bug or a bug in your code. It's you :-)
That's the previous candle.
Thanks and point taken. Silly mistake!
Thanks again.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is it me or have I discovered a bug with the CCI calculation in MetaTrader 4?
I'm using this EA code...
which displays the CCI result for both the Day and Hour periods.
When I compare the result with the actual periods selected within MetaTrader I get two different results. Why? Which is correct? If my code is wrong where is the error? Have a made a stupid mistake?
Here's screenshots of the CCI indicator using the Day and Hour periods.
Day Period
Hour Period
Thanks in advance for your help.