Confirm latest transaction profit

 
I'm going to choose the last deal.

As shown below, the profit and loss of all transactions will be shown.


I choose the last transaction, and I want to see the gain of the transaction, but where should I fix it?


for(int i = HistoryTotal()-1; i>= 0 ; i--)
   {
   if(OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))
   continue;
   
   Print(OrderProfit());
        
   }
 
cape1354: I'm going to choose the last deal.
  1. You are not choosing anything with that code.

  2. You've ignored previous comments. Order after a certain amount of time - Stop Loss - MQL4 and MetaTrader 4 - MQL4 programming forum #1.2 #1.4