how we can verfied if the last trade is win or a loose trade ?

 

how we can verfied if the last trade is win or a loose trade ?

what is the functions and commands that we must use or a little exemple of script?

Thank you very much,  seriously i need your help to finish my strategy

 

Hi ...

I did this function in some of my codes ... It returns Last  order type, Last order Lots and Last order Profit ...

So, just check in your main code if last order profit >=0 ... It works charm :) 

void LastClosedTrade(){ 
   int cnt, total; 
   total = OrdersHistoryTotal(); 
   for(cnt=0;cnt<total; cnt++){ 
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY)==true)
   
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderProfit()!=0){
         LastOrderType = OrderType(); 
         LastOrderLots = OrderLots(); 
         LastOrderProfit = OrderProfit(); 
      }
   }
}
Reason: