Errors, bugs, questions - page 1424

 
Vladimir Pastushak:
So the history will start to be written from the moment the symbol is set in the market overview ?
Yes or after the history is turned in the indicator/script/advisor.
 

What kind of bug is this? It doesn't happen all the time, it just pops up from time to time.


NormalizeDouble(value, 4);

but outputs this

0.5484000000001

 
Itum:

What kind of bug is this? It doesn't keep popping up every once in a while.


NormalizeDouble(value, 4);

it outputs this

0.5484000000001

Where does it go ?
 
Itum:

What kind of bug is this? It doesn't keep popping up every once in a while.


NormalizeDouble(value, 4);

and prints this

0.5484000000001

This is from the help:


NormalizeDouble
................................
Please note that when output to Journal using Print(), a normalized number may contain more decimal places than you expect. For example,

double a=76.671;// normalized number with 3 decimal places
Print("Print(76.671)=",a);// print it as is
Print("DoubleToString(a,8)=",DoubleToString(a,8));// print with a specified accuracy

will output in the terminal:

DoubleToString(a,8)=76.67100000

Print(76.671)=76.67100000000001

 
Vladimir Pastushak:
Where does it output ?
write to a file.
 
Mike:

This is from the reference:


NormalizeDouble
................................
Please note that when output to Journal using Print(), a normalized number may contain a larger number of decimal places than you expect. For example,

double a=76.671;// normalized number with 3 decimal places
Print("Print(76.671)=",a);// print it as is
Print("DoubleToString(a,8)=",DoubleToString(a,8));// print it with the specified accuracy

will give out in the terminal:

DoubleToString(a,8)=76.67100000

Print(76.671)=76.67100000000001


What's the bug?
 
Yury Kirillov:

What's the bug?

is that it has to be 4 digits ! There are cases that give 4 characters, and there are cases with ... 0000000001 ! Why is it that the same function sees different values ?

How do I round the value to 4 digits ...

-----------------------------------------------------------------------------------

NormalizeDouble(value, 4);

but outputs this

0.5484000000001

 
Itum:

is that it has to be 4 digits ! There are cases that give 4 characters, and there are cases with ... 0000000001 ! Why is it that the same function sees different values ?

How do I round the value to 4 digits ...

-----------------------------------------------------------------------------------

NormalizeDouble(value, 4);

but outputs this

0.5484000000001

DoubleToString
 

Why can't I do this?

 for(int h=0; h<=10;h++){
      for(int d=10; d<=20;d++){

      min_array[h]=d;

} }
How to implement such a code ?
 
Itum:

Why can't you do that?

How to implement this code ?

Use a code styler.

And an array must first be declared before it can be accessed:

   int min_array[10];
   for(int h=0; h<=10;h++)
     {
      for(int d=10; d<=20;d++)
        {
         min_array[h]=d;
        }
     }
Reason: