How to store the last order type (Buy/Sell)? - page 3

 
bool BuyOrSell(){
   bool Order_Type = true;
   for(int g = 0; g < OrdersHistoryTotal(); g++){
      if(OrderSelect(Order_Ticket, SELECT_BY_TICKET) == true){
         if(OrderType() == 0){
            Order_Type = true;
         }else if(OrderType() == 1){
            Order_Type = false;
         }
      }  
   }
   return(Order_Type);
}
 
Wessam Nabil:

This seems like something someone would post to troll... There's no way this is for real. 

 
nicholi shen:

This seems like something someone would post to troll... There's no way this is for real. 

ya sorry

replace this code 

if(OrderSelect(Order_Ticket, SELECT_BY_TICKET) == true)

with this

if(OrderSelect(g, SELECT_BY_POS, MODE_HISTORY))

then caLL IT ANYWHARE

Reason: