Divide the difference by _Point and print it out with DoubleToString():
double vSMA = ..., vEMA = ...; Comment(DoubleToString((vEMA-vSMA)/_Point,2));
(Not tested just typed!)
Sneck55: when I print it gives the answer in exponential notation which is completely useless to me.
If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
question about decima of marketinfo() - MQL4 programming forum (2016)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I am trying to find the difference between two moving averages but when I print it gives the answer in exponential notation which is completely useless to me. The answer (on GBPUSD) could be 0.00001 or 0.00005 etc. That is the information I need. I have tried using NormalizeDouble() and not using it but both produce the same result whether I use Digits or just specify the number of digits as 5. Surely somebody must have done this before!
Thanks,
Phil