CopyClose and CopyOpen return bad result after close and reopen metatrader5
I am comparing two copyclose with same parameters and I receive different result from this functions;
if(iClose1 != iClose2)
Print("ERROR: ",iClose1," != ",iClose2);
Print(iClose1," = ",iClose2);
And this code on open metatrader5 print this result:
2454.0 = 2454.0
ERROR: 9.79818532658781e-312 != 7.138640856869782e-189
Can anyone help me?!
Forum on trading, automated trading systems and testing trading strategies
Please EDIT your post and use the SRC button when you post code.
You have to understand the way double values work, e.g. here!
Two doubles are practically never equal like integers only too close to be different!
if(fabs(iClose1-iClose2) > _Point*0.001) ...