
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
angevoyageur - OK, sorry I didn't put the full code in - what you have written is my real code. I attached it wrongly.
Raptor - if I understand your code then it is a work around but you are still only working to a number of digits less than 8. So most brokers now work with 5 digits as standard - if you compare values at a half point either side this is still not as accurate a working with 8 digits which is the max. resolution of MT4.
Guys, this is just the beginning - what I want to do is search the array for duplicate values. So if there are 5 array elements equal to 1.61234 then that's what I want to know. So it doesn't fill me confidence when ArrayBSearch can't even find 1 value that I choose accurately!!
This should be a no brainer - how many digits precision do you need for it to get the right number for the search?
Raptor - if I understand your code then it is a work around but you are still only working to a number of digits less than 8. So most brokers now work with 5 digits as standard - if you compare values at a half point either side this is still not as accurate a working with 8 digits which is the max. resolution of MT4.
You can get more resolution than 8 digits . . . but it doesn't matter, the fundamental issue is comparing doubles. You need to understand the issue of comparing doubles regardless of this ArrayBsearch() issue. . you should read this thread: Can price != price ? from start to finish, if you don't understand then read it some more and do some research using Google.
Raptor, we need to keep this simple. Built in code is meant to help the user - so why, in this situation is so difficult to find a value in an array accurately?
Your code only uses 5/6 digit accuracy.
Also, I thought MT4 precision was limited to 8 digits. Otherwise it just gets ridiculous!
Asked and answered. Read the links: The == operand. - MQL4 forum The problem has nothing to do with mt4. It's the same problem on every computer that uses floating point numbers
Anyway I can't reproduce the problem.
With all tested value I got the good index.Raptor, we need to keep this simple. Built in code is meant to help the user - so why, in this situation is so difficult to find a value in an array accurately?
Your code only uses 5/6 digit accuracy.
Also, I thought MT4 precision was limited to 8 digits. Otherwise it just gets ridiculous!
I think I've sorted it. I don't really know how but it seems to be working.
Thanks for everybody's help.