Why do I only get rounded (4 decimal) values??

 

Hi,

can somebody tell me why this script only displays rounded, 4-decimal values, although I use a 5-digit-broker?

int start()
  {
//----
   datetime drop_time   = WindowTimeOnDropped();
   int shift            = iBarShift(NULL, 0, drop_time);
   double BarHigh       = iHigh(NULL, 0, shift);
   double BarLow        = iLow(NULL, 0, shift);
   double BarOpen       = iOpen(NULL, 0, shift);
   double BarClose      = iClose(NULL, 0, shift);
   Comment(BarOpen, "  |  ", BarHigh,"  |  ", BarLow,"  |  ",BarClose);
//----
   return(0);
  }
 
mar:

Hi,

can somebody tell me why this script only displays rounded, 4-decimal values, although I use a 5-digit-broker?

It's because you didn't read the documentation and you are running old mql4 code . . . Comment()

Old mql4 code Comment() "Data of double type output with 4 digits after the decimal point. To output with more precision, use the DoubleToStr() function."
 

Thanks for your kind advice, Raptor! ;)

By the way.. my broker has not offered build 600 yet.

I also used Print() to check it twice and now I read that Print() also works with 4 decimals only..

 
mar:

Thanks for your kind advice, Raptor! ;)

By the way.. my broker has not offered build 600 yet.

I also used Print() to check it twice and now I read that Print() also works with 4 decimals only..

Yup, there is no online Documentation for the "old" mql4 but you can get it in your version of MetaEditor.
 

Raptor, one small issue.. When I drag a script to the chart using #property show_inputs I have two options. One is "General" and the other is "Input". Is there a possibility that the Input-Window for the parameters is opened first? I always have to activate "Input" before I can change parameters.


 
mar:

Raptor, one small issue.. When I drag a script to the chart using #property show_inputs I have two options. One is "General" and the other is "Input". Is there a possibility that the Input-Window for the parameters is opened first? I always have to activate "Input" before I can change parameters.

If it is possible I don't know how . . . I doubt it though.
 
Ok...
Reason: