calculating total lot size (volume) of hedged positions and getting TP and SL of the first (oldest bu still running) position...

 
Hi. I am coding my first(i know basics) MQL5 project, it is a hedging expert advisor that will open multi directional trades(sells and buys)... i am stuck and would appreciate your assistance, I need to sum the total lot size(volume) of running positions and display it... the second problem is, i need to get TP and SL of the first(oldest) opened position (in multiple opened positions)  and maybe store them in variables, so i can use them in other trades. Thank you.
 
Example loop to traverse all positions in the code Example: Calculate Positions and Pending Orders
How to start with MQL5
How to start with MQL5
  • 2020.03.12
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...