kumaillakhani:
This is not your fault, it's a feature of double type. NormalizeDouble() provides rounding (BTW in a slightly non standard way) to required number of decimal places. But double is still double.I have tried both code from both code after decimal value appearing 16 digits. Where I have made mistake?
It could be dangerous to normalize prices (stop loss and take profit are also prices) by NormalizeDouble() because not always a tick size is equal to points.
Petr Nosek:
This is not your fault, it's a feature of double type. NormalizeDouble() provides rounding (BTW in a slightly non standard way) to required number of decimal places. But double is still double.
It could be dangerous to normalize prices (stop loss and take profit are also prices) by NormalizeDouble() because not always a tick size is equal to points.
Could you please provide a reference to the rounding standard(s) ? Thanks.
This is not your fault, it's a feature of double type. NormalizeDouble() provides rounding (BTW in a slightly non standard way) to required number of decimal places. But double is still double.
It could be dangerous to normalize prices (stop loss and take profit are also prices) by NormalizeDouble() because not always a tick size is equal to points.
May be you should read this here: http://articles.mql4.com/866

Working with Doubles in MQL4
- www.mql5.com
The MQL programming opens new opportunities for the automated trading, many people all over the world already have appreciated it. When we are writing an Expert Advisor for trading, we must be sure that it will work correctly. Many newbies often have some questions when the results of some mathematical calculations differ from those expected...
Alain Verleyen:
Could you please provide a reference to the rounding standard(s) ? Thanks.
Could you please provide a reference to the rounding standard(s) ? Thanks.
https://physics.nist.gov/cuu/pdf/sp811.pdf
appendix B.7 on page 43
Thanks Petr.
However what I wanted to point is there is no reason to think Metaquotes is following any standard if not documented, certainly not a US standard.
Alain Verleyen:
You're right that Metaquotes doesn't have to follow any standard (SI is not an US standard, but an international standard).
Thanks Petr.
However what I wanted to point is there is no reason to think Metaquotes is following any standard if not documented, certainly not a US standard.
Petr Nosek:
You're right that Metaquotes doesn't have to follow any standard (SI is not an US standard, but an international standard).
You're right that Metaquotes doesn't have to follow any standard (SI is not an US standard, but an international standard).
NIST is US, it's what I meant.
US like to think they are the "international standard". But it's not the place to discuss about that.

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
I have tried both code from both code after decimal value appearing 16 digits. Where I have made mistake?