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
Mathematics. Grade 6. Textbook. Nikolsky S.M., Potapov M.K. Moscow: 2012. - 256 с
Rounding.
What a heated topic this has turned out to be. MT4 seems to work correctly with rounding.
I meant forNormalizeDouble(0.055,2) not to round the number"0.055" to "0.06", but to trim it to "0.05".
I'm having trouble understanding these MKL functions. I don't really understand why "1.0015223567" should be rounded with the NormalizeDouble function, if all you want is to take the BORROWN number to the right place.
That is, to NormalizeDouble(1.001526789, 5) would result in "1.00152". It does not need to be roundedto "1.00153". There must be the RoundDouble function for that =)
Is it possible? Or is it necessary to round it all the time and get the wrong numbers?
You'd better make up your mind already. It's rounding:
Forum on trading, automated trading systems and trading strategy testing
Rounding numbers in MT4 via NormalizeDouble
Roman Starinskij, 2016.01.21 10:03
Hello. Can you tell me what is the problem.
Why function NormalizeDouble(0.055,2) rounds number "0.055" to "0.06"?
It's not a fraction rounding function.
It does not:
Forum on trading, automated trading systems and strategy testing
Rounding numbers in MT4 via NormalizeDouble
Roman Starinskij, 2016.01.25 14:30
What a heated topic this has turned out to be. MT4 seems to work correctly with rounding.
I meantNormalizeDouble(0.055,2) not to round the number"0.055" to "0.06", but to trim it to "0.05".
I'm having trouble understanding these MKL functions. I don't really understand why "1.0015223567" should be rounded with the NormalizeDouble function, if all you want is to take the DIRECT number to the right place.
That is, to NormalizeDouble(1.001526789, 5) would result in "1.00152". It does not need to be roundedto "1.00153". There must be the RoundDouble function for that =)
Is it possible? Or is it necessary to round it all the time and get numbers you don't want?
And for the sake of experimentation:
What a heated topic this has turned out to be. MT4 seems to work correctly with rounding.
I meant forNormalizeDouble(0.055,2) not to round the number"0.055" to "0.06", but to trim it to "0.05".
I'm having trouble understanding these MKL functions. I don't really understand why "1.0015223567" prices should be rounded using NormalizeDouble function, if all you want is to take the DIRECT number to the right digit.
That is, to NormalizeDouble(1.001526789, 5) would result in "1.00152". It does not need to be roundedto "1.00153". There must be the RoundDouble function for that =)
Is it possible? Or do you need to round it all the time and get numbers you don't want?
If you need to trim, then trim; if you need to round, then round. The NormalkizeDouble() function rounds and this is what you need most often.
Why do you think RoundDouble() should be used instead of NormalizeDouble()? Did you create this world? Is it OK that a ball is rolling and a square has four corners?
What a heated topic this has turned out to be.
This is because the author does not read the language documentation and does not listen to what he is told.
The following behaviour of dividing and rounding fractions is a little unclear.
There are 2 equations:
0.06-0.02 = 0.03999999999999999
0.06-0.024 = 0.036
Using the recommended NormalizeDouble function, we get these results:
0.03999999999999999 = 0.04
0.036 = 0.04
In the first example we really need to get the value 0.04, but in the second one we need 0.03 (this is how a normal calculator works).
NormalizeDouble should be used because fractions are returned that are not complete, but in the second case, the function returns incorrect values, and you can't not use it for the first example either.
The following behaviour of dividing and rounding fractions is a little unclear.
There are two equations:
0.06-0.02 = 0.03999999999999999
0.06-0.024 = 0.036
Using the recommended NormalizeDouble function, we get these results:
0.03999999999999999 = 0.04
0.036 = 0.04
In the first example we really need to get the value 0.04, but in the second one we need 0.03 (this is how a normal calculator works).
NormalizeDouble should be used because fractions are returned that are not complete, but in the second case, the function returns incorrect values, and you can't not use it for the first example either.
Your normal calculator does not calculate correctly, it should:
All because the topicstarter does not read the language documentation and does not listen to what he is told
if N+1 digit < 5, then the Nth digit is retained and N+1 and all subsequent digits are zeroed;
if N+1 digit ≥ 5, the Nth digit is incremented by one and N+1 and all subsequent digits are zeroed;
Sorry, but I still do not understand why rounding by '2' does not immediately allow = 0.06000000
v1 = 0.06000000, v2 = 0.06000000
v1 = 0.06000000, v2 = 0.05000000
---
I'm sorry, but I still don't understand why rounding by '2' doesn't make it possible to get = 0.06000000
I'm sorry, but I still don't understand why rounding by '2' makes it impossible to get = 0.06000000
When only one digit is normalized, it is simple: 0, 1, 2, 3, 4 -> 0, and 5, 6, 7, 8, 9 -> 1.
When two digits are normalized, two-digit numbers are taken into account: 0 - 49 -> 0, and 50 - 99 -> 1. After all, if the number 1.49 has to be rounded to integers, do we really have to get 2, which is 51 hundredths vs. the available 49 hundredths distance to 1?
Same with three-digit, four-digit, etc.