Price issue (bug?): unexpected number of decimals (too many!)
Please read the documentation carefully : Print()
Data of double type are shown with the accuracy of up to 16 digits after a decimal point, and can be output either in traditional or in scientific format, depending on what entry will be more compact. Data of float type are output with 5 digits after a decimal point. To output real numbers with another accuracy or in a predefined format, use the PrintFormat() function.
See also these topics Can price != price ?, what is a double ?
double t = 10/81.; Print(DoubleToString(t,15)); // tests USDCHF,H1: 0.123456790123457See also The == operand. - MQL4 forum
I have an issue when using several candle prices.If I use:
Print(Close[33]);
to print the value of a given candle, I get: 2016.05.04 11:17:55.733 Indicator - CADCHF,M15: 0.7507200000000001
This happens occasionally with some candles, not all.
I've tried to limit the number of decimals, but still get the same:
Print(NormalizeDouble(Close[34],Digits)+" "+MarketInfo(Symbol(), MODE_DIGITS));
and get 2016.05.04 11:17:55.736 Indicator - CADCHF,M15: 0.7507200000000001 5
I've also check the History Center to see if the price data base was corrupt, but it shows 0.75072
I've also restarted MT4, but get the same result.
I've checked around in the internet and have not bee able to find anything related to this issue.
Does anybody have any idea why this may be happening?