about last order

 

can some one slove this cod plz

about last order

double LastOrderInfoSell(string Info,int type =-1)

{
   for(int i =OrdersTotal ()- 1 ; i>=0;i--) {
     if (OrderSelect (i,SELECT_BY_POS,MODE_TRADES))
     if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && (OrderType()==type ))
      {
             if(Info=="Type")           return ( OrderType() == OP_SELL);
      
              else   if(Info=="Price")          return (OrderOpenPrice()==OP_SELL );
                                            
      }
      }return (0);
      
      }
     
     
     
 
 double LastOrderInfoBuy(string Info,int type =-1)

{
   for(int i =OrdersTotal ()- 1 ; i>=0;i--) {
     if (OrderSelect (i,SELECT_BY_POS,MODE_TRADES))
     if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && (OrderType()==type ))
      {
             if(Info=="Type")           return ( OrderType() == OP_BUY);
      
              else   if(Info=="Price")          return (OrderOpenPrice()==OP_BUY );
                                            
      }
      }return (0);
      
      }
 
ALI AMRIOUI: can some one slove this cod plz
  1. This is an international English forum; Post in English. Slove and plz are not a word, cod is a fish.
              Please don't write ur - it's "you are" or "your" - MQL4 programming forum (2014)

  2. if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && (OrderType()==type ))
    There is no negative order types. Therefor, your OrderSelect loop will never select anything.
 
William Roeder #:
  1. This is an international English forum; Post in English. Slove and plz are not a word, cod is a fish.
              Please don't write ur - it's "you are" or "your" - MQL4 programming forum (2014)

  2. There is no negative order types. Therefor, your OrderSelect loop will never select anything.

thanks friend 

Reason: