miko.szy: if (SpanA_Buffer[0] == SpanB_Buffer[0])
The == operand. - MQL4 forum
Thank you very much for your quick response.
I read through "working with doubles in MQL4" earlier, and checked and tested with some functions.
Now, I just changed the location of NormalizeDouble, from the section where I calculate values to the section where I actually assign the calculated result to the array.
Then result was very much improved!
Thank you for your help. Much appreciated.
miko.szy: I read through ... Now, I just changed the location of NormalizeDouble,
But apparently hard of reading. One of the links points out that I state that you should NEVER use NormalizeDouble for any reason. It's use is always wrong.
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,
I found similar topics on Forum, but they sounded not quite same as my case, and decided to post this one.
I have following source code.
double SpanA_Buffer[], SpanB_Buffer[];
//These arrays are re-sized and also initialized as follow.
ArrayResize(SpanA_Buffer, a_begin-1);
ArrayInitialize(SpanA_Buffer, 0.0);
ArrayResize(SpanB_Buffer, Senkou-1);
ArrayInitialize(SpanB_Buffer, 0.0);
if (SpanA_Buffer[0] == SpanB_Buffer[0]) Print("Passed if (SpanA_Buffer[0] == SpanB_Buffer[0])");
Here is extracts from log file.
*** Successful case ***
SpanA_Buffer[0] = 0.8911 SpanB_Buffer[0] = 0.8911
Passed if (SpanA_Buffer[0] == SpanB_Buffer[0]
*** Failing case ***
SpanA_Buffer[0] = 0.8968 SpanB_Buffer[0] = 0.8968
I tried NormalizeDouble, but these values above do not really require to be rounded.
Moreover, when I tested with this function, values were rounded, and I couldn't get desirable result.
Majority of the comparison actually failed.
If someone could give me any advice, it would be much appreciated.