How can get average profit value of buy and sell oders

 

When opening multiple buy and sell orders.

Need to close buy orders at their average profit value and sell order also.

How can calculate averae profit value for buy and sell orders.

first collect order open prices and lot sizes.

And how calculate average buy profit price and sell profit price.

Some exsiting codes calculate only average price for both buy and sell orders

 
  1. Loop through the open orders and sum OrderProfit()+OrderSwap()+OrderCommission() to two variables depending on OrderType() or to an array[OrderType()].
  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12