Open[] with 5 decimal broker

 

Hi,


I would like to compare Open[0] and Open[1].

My broker uses 5 decimal. So, I would like to compare them as 5 decimal number.

In Data window, I can see Open price with 5 decimals.

However, when I do Print() it, it appears only with 4 decimals.

ex) On data window, Open[0] = 0.89594 However, it appears as 0.8959 on log file.

I tried followings.

Print("Open[0] = ", Open[0]);

double open0 = Open[0]

Print("Open[0] = ", NormalizeDouble(open0, 5)) ;

open0 = NormalizeDouble(open0, 5);

Print("Open[0] = ", open0 ) ;

If anybody has any idea, your comment is much appreciated!

 
miko.szy: However, when I do Print() it, it appears only with 4 decimals.
Print("Open[0] = ", NormalizeDouble(open0, 5)) ;
  1. RTFM
    Data of double type are printed with 4 decimal digits after point. To output more precisely, use the DoubleToStr() function.
  2. NormalizeDouble returns a double, INFINITE digits. Makes no difference to Print. Use PriceToStr()
  3. NormalizeDouble is a kludge, don't use it. It's use is always wrong.
 

Gosh... it was Print() related issue...

WHRoeder, thanks again. Much much appreciated!

Reason: