but, still didn't print the "Buy!!" why ???

 
Print(Bid+"<"+CheckLowest());
                  if (Bid < CheckLowest())
                  {
                     Print("Buy!!");
                  }

below is the journal log

2012.11.06 22:03:06    2012.11.01 13:15  Bar GBPUSD,H1: 1.61115000<1.61169000


but, still didn't print the "Buy!!" why ???

 
anthor:

below is the journal log

2012.11.06 22:03:06    2012.11.01 13:15  Bar GBPUSD,H1: 1.61115000<1.61169000


but, still didn't print the "Buy!!" why ???

I don't know the calculation inside CheckLowest() function, but try to assign it to some variable and see

double abc, xyz;
abc = Bid;
xyz = CheckLowest();
Print(abc+"<"+xyz); 
if (abc < xyz)
    {
    Print("Buy!!");
    }
 
anthor:

below is the journal log

2012.11.06 22:03:06    2012.11.01 13:15  Bar GBPUSD,H1: 1.61115000<1.61169000


but, still didn't print the "Buy!!" why ???

Because the code you have there did not output what you have shown to the log . . .  Print() outputs 4 decimal digits,  what you have there in the log is 8 . . .  that code did not produce that log output . . . .  find the code that did.
 
 
RaptorUK:
Because the code you have there did not output what you have shown to the log . . .  Print() outputs 4 decimal digits,  what you have there in the log is 8 . . .  that code did not produce that log output . . . .  find the code that did.
Print(Bid+"<"+CheckLowest());
Sorry Raptor, you're wrong this time. If the code was
Print(Bid,"<",CheckLowest());
you'd be correct but double+string expands to 8 digits.
 

WHRoeder:
Sorry Raptor, you're wrong this time. If the code was

 

 . . . you'd be correct but double+string expands to 8 digits.
I'm happy to be wrong,  it means I learn something in the process . . . .  so the implication is that  CheckLowest()  returns a string and that would explain why the  <  comparison fails and   Buy!!  isn't printed  ?
 
WHRoeder:
Sorry Raptor, you're wrong this time. If the code wasyou'd be correct but double+string expands to 8 digits.

What is the return type of CheckLowest() function ?, Is it string or double ?

If its double, it should print correctly

double abc, xyz;

abc = Bid;
xyz = CheckLowest();

Print(DoubleToStr(abc, 8) + "<" + DoubleToStr(xyz, 8)); 
if (abc < xyz)
    {
    Print("Buy!!");
    }

 But if its a string, well, you can not compare double with string, can you ?