faustf:
hi guys i try to do a simply script
but 6° candle return me error value ,because the result is 3,999999999 but open value is 0.99104 and close vale is 0.99108
why???
The result is 3,999999999992898e-5 which is 0.00003999999999992898
Try this code
Comment (NormalizeDouble(Close[6]-Open[6], Digits());
amrali: Try this code
Try that code and get the same result.
Floating point has infinite number of decimals, it's your not understanding
floating point and that some numbers can't be represented exactly. (like 1/10.)
Double-precision floating-point format - Wikipedia, the free encyclopedia
See also The == operand. - MQL4 programming forum
Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
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
hi guys i try to do a simply script
but 6° candle return me error value ,because the result is 3,999999999 but open value is 0.99104 and close vale is 0.99108
why???