Download MetaTrader 5

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

To add comments, please log in or register
Do you need private account monitoring? The Signals will provide you one!
mar
1146
mar 2014.02.19 14:52 

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);
  }
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.19 14:58  
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."
mar
1146
mar 2014.02.19 15:06  

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..

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.19 15:11  
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.
mar
1146
mar 2014.02.19 16:35  

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.


Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.19 17:18  
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.
mar
1146
mar 2014.02.19 17:24  
Ok...
To add comments, please log in or register