5 decimal places Problem. New comment Peter 2009.01.09 06:44 I'm using Alpari who have just gone to 5 decimal places. The code: double slow = iMA(Symbol(),PERIOD_M15,14,0,MODE_SMA,PRICE_CLOSE,0); Printing the code will produce a number to four decimal places eg 0.8991 But the indicator on the chart prduces number to 5 decimal places 0.089937 which is quite different SEE IMAGE Mismatch As you can see the numbers are quite different, but should surely be the same? All offers of help appreciated. Pete Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes Decimal Places for defining Points, not Pips in MT5? Shorten # of digits in a variable. Alexander 2009.01.09 09:47 #1 As a variant double slow = NormalizeDouble(iMA(Symbol(),PERIOD_M15,14,0,MODE_SMA,PRICE_CLOSE,0),4); Peter 2009.01.09 20:16 #2 Roger: As a variant double slow = NormalizeDouble(iMA(Symbol(),PERIOD_M15,14,0,MODE_SMA,PRICE_CLOSE,0),4); Hi Roger I tried that but it doesn't work. Pete New comment
I'm using Alpari who have just gone to 5 decimal places.
The code:
double slow = iMA(Symbol(),PERIOD_M15,14,0,MODE_SMA,PRICE_CLOSE,0);
Printing the code will produce a number to four decimal places eg 0.8991
But the indicator on the chart prduces number to 5 decimal places 0.089937 which is quite different SEE IMAGE
Mismatch
As you can see the numbers are quite different, but should surely be the same?
All offers of help appreciated.
Pete