Use the new "DoubleToString" function to convert the Double into a String of the precision you require (see example below).
Alert( "mMACD = ", DoubleToString( mMACD, Digits ), " mMACDSignal = ", DoubleToString( mMACDSignal, Digits ) );
This function was previously denoted as "DoubleToStr" in the previous builds, but use the new version for forward compatibility.
MQL5 Reference: https://www.mql5.com/en/docs/convert/doubletostring
Old MQL4 Reference: https://docs.mql4.com/convert/DoubleToStr
Use the new "DoubleToString" function to convert the Double into a String of the precision you require (see example below).
This function was previously denoted as "DoubleToStr" in the previous builds, but use the new version for forward compatibility.
MQL5 Reference: https://www.mql5.com/en/docs/convert/doubletostring
Old MQL4 Reference: https://docs.mql4.com/convert/DoubleToStr
Now it is fixed. Thank you very much!
- 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 guys,
I have this code in my indicator and I would like to get rounds the floating point values to the six digits for example -0.000092 as it is the value of the MACD indicator. The issue is that I get -0.0001. Could you help me how to fix this ?