Download MetaTrader 5

whats wrong with this small function (*_*)..........

To add comments, please log in or register
Do you know that MQL5 has structures?
tafadzwa
117
tafadzwa 2013.11.14 13:27 
// catch value of bid if no order is opened.

double line_of_trades( )
  {
 static double the_line=0;  // save value btwn repeated calls.
    int total=OrdersTotal();
    
 if(total>0)
   {
   the_line=0;
    return(0);
    }
 
 if(total<1 && the_line>0)
  {
   Print("The Line is There");
   return(0);
  }
 
 if(total<1)
  {
   the_line=Bid;
   return(the_line);
  }
}
whroeder1
14480
whroeder1 2013.11.14 14:30  
tafadzwa: whats wrong with this small function
Nothing, it just doesn't do what you think it should.
To add comments, please log in or register