Error when compare value

 

Hi all,

I write a little code for comparing candle size. But i get a error .My code is :

double dRCandleSize = High[1] - Low[1];

double  dSCandleSize = High[2] - Low[2]; 

if (dRCandleSize  >= dSCandleSize)

{

	Print ("Valid"); 

} 

else Print ("Invalid") ;

Print (NormalizeDouble(dRCandleSize,5));

Print (NormalizeDouble(dSCandleSize,5)); 

And i get result :

Invalid

0.0005 

0.0005

So, I dont understand why 0.0005 can't >= 0.0005 ?

Please help me to fix this issue. Thanks a lot

Bizu

 
bizu:

Hi all,

I write a little code for comparing candle size. But i get a error .My code is :

And i get result :

So, I dont understand why 0.0005 can't >= 0.0005 ?

If you had read today's posts you would have seen this .. . https://www.mql5.com/en/forum/146452
 
Print (NormalizeDouble(dRCandleSize,5));
  1. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a cludge, don't use it.Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
    Can price != price ? - MQL4 forum
  2. On Currencies, Point=TickSize, so you will get the same answer. It won't work on Metals.
 
I understand. Thanks a lot
Reason: