Help request to find a function

 
Hi everyone, I'm looking on mql5 for a function that calls the result of the old closed positions. more precisely: the result of the last closed position.
Thank you.
 
MOMO66 :
Hi everyone, I'm looking on mql5 for a function that calls the result of the old closed positions. more precisely: the result of the last closed position.
Thank you.

If you want to get the value of the last closed TRANSACTION directly in the advisor, work through OnTradeTransaction. In other cases, you need to raise the trading history through HistorySelect.

 
Vladimir Karputov:

If you want to get the value of the last closed TRANSACTION directly in the advisor, work through OnTradeTransaction. In other cases, you need to raise the trading history through HistorySelect.

Thank you for your reply.