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
MT4:NormalizeDouble - General - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum
Assumes that ND rounds or truncates. Write self-documenting code and specify exactly which you mean.
MT4:NormalizeDouble - General - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum
This is wrong.
it should be
Assumes that ND rounds or truncates. Write self-documenting code and specify exactly which you mean.
Is there anyone else who did not understand this simple example?
For whroeder1:
In this example I have a variable "profitUSD" (self-documenting). Its value is e.g. profit in USD and I want to find out profit in EUR but just on two decimal places. I use ND to set the variable "profitEUR" (self-documenting).
And now I want you to explain what is wrong with using ND.
You assume ND(x,0) rounds to the nearest integer. MathRound always does to the nearest int by definition. ND use is wrong.
What is this nonsense? Neither of those returns an int!
Let's prove this quantitatively with a simple script.
SPOILER ALERT!!!
I just wanted to comment that there's no shame in admitting when one is wrong. That's what science is all about, adapting to new evidence as it is brought to light. I, for one, will gladly admit to being proved wrong with new evidence - because I'd rather be correct and humble than arrogant and wrong. That being said, if there's anyone in particular whro's in denial, I say, embrace the new evidence! Perhaps a simple change in language is the difference between being correct and being totally wrong... perhaps one should change one's phrasing to something like, "its use is always usually wrong".
Congratulations, you found a bug in MathRound.
Ok... next step... since NormalizeDouble works correctly - what is your final conclusion?
I totally agree with this.
Me too. That's a five years old discussion with WHRoeder, he never understood it, I never understood why he didn't.
Forum on trading, automated trading systems and testing trading strategies
Round Number
Alain Verleyen, 2013.08.29 16:00
Of course it's the simplest solution. It's not because WHRoeder don't use NormalizeDouble that you can't use it.