identifying variable issue mql4

 

hi im trying to find the lowest of last 8 bars , if i put it like this 

double x=Low[iLowest(Symbol(),0,MODE_LOW,8,1)]; 
double xx=Low[1];
Print("LOWEST OUT OF 8",x);
Print(Low[1]);

the x print fine ,but the xx print as 0.0, if i substitute the xx in the print statment with Low[1] i get the value

i intended to get , any help please 

Files:
TEST2.mq4  2 kb
 

First of all fix all warnings using DoubleToString while printing double values.

 
Fabio Cavalloni:

First of all fix all warnings using DoubleToString while printing double values.

i dont want it as string i want it as double i want to preform calculation on the number this is just a sample of my code

 
mo798ua: i dont want it as string i want it as double i want to preform calculation on the number this is just a sample of my code

You already have a double. Why are you posting?

If you want to print it, you need it as a string.

Floating-point has infinite number of decimals, it's your not understanding floating-point and that some numbers can't be represented exactly. (like 1/10.)
          Double-precision floating-point format - Wikipedia, the free encyclopedia

See also The == operand. - MQL4 programming forum

Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.

 
Fabio Cavalloni:

First of all fix all warnings using DoubleToString while printing double values.

ok i used the doubletostring and yet does not work 

x=Low[iLowest(Symbol(),0,MODE_LOW,8,1)]; 
   xx==Low[1];
  //drawlabel(0,"swing l to be checked1",514,10,CORNER_LEFT_UPPER,StringConcatenate("this is swing low candle "+isthiscandleswingl()+" becaue the curr low is "+xx),15,DarkOrange,true,false); 
  //drawlabel(0,"swing l to be checked2",1300,10,CORNER_LEFT_UPPER,StringConcatenate(" and lowest candle in range of 8 "+x),15,DarkOrange,true,false); 
Print("Lowest of 8 ",x);
Print("Current Low ",DoubleToString(xx,Digits ));
 
 
You have not used DoubleToString on X
Anyway, what does it mean "does not work"?
 
Fabio Cavalloni:
You have not used DoubleToString on X
Anyway, what does it mean "does not work"?

the problem that blow my mind is x print the right value but xx does not here see the attachmeant u will get me

Files:
xx.PNG  6 kb
 
mo798ua:

the problem that blow my mind is x print the right value but xx does not here see the attachmeant u will get me

You assigned value of XX with == instead of =
== Is a compare operator, not an assignment one.
Look better at the code, it's only 3 rows.
 
Fabio Cavalloni:
You assigned value of XX with == instead of =
== Is a compare operator, not an assignment one.
Look better at the code, it's only 3 rows.

silly  mistake ,thank you

Reason: