The attached EA calculates the average price and close all positions
for specified pairs only when the specific pair is $x above average price.
Instead of closing all the positions of a specific pair when price level is $x above the overall average price, Can you modify it such that Only the positions which are in profit are closed when price reaches $X or pips above average price of all positions but simultaneously apply a trailing stop
$Ypips for all the remaining positions (for that specific pair) which are still in negative? Thanks.