Download MetaTrader 5

Get Profit/Loss of Most Recently Closed Position by Pair

To add comments, please log in or register
Deklin
26
Deklin  
Using MQL4, how can I get the profit / loss for the most recently closed position for a specific pair?  
whroeder1
15590
whroeder1  
  1. Find "most recently closed position for a specific pair" 
  2. Select that order.
  3. Profit = OrderProfit() + OrderCommission() + OrderSwap
Deklin
26
Deklin  
How can I find the "most recently closed position for a specific pair"?
DeanDeV
330
DeanDeV  
deklin:
How can I find the "most recently closed position for a specific pair"?

Cycle through OrdersHistoryTotal() by using OrderSelect() and for specific pair OrderSymbol()

To add comments, please log in or register