仕事が完了した
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
Hi Coders,
-I need a closing script to manage my EA open positions.
-The EA is Hedging with Martingale functions(Fibonacci sequence in ZigZag order).
-What i want from the Script, is to help me to AVOID to have too many big positions open, and i want to close them separetly-accordingly.
EXAMPLE:(look the attached picture)
"FIXED" POSITIONS CLOSE:
-Need to calculate the net position and when reach the TP, then close ALL position in the sequence.
(The TP need to measured from the weighted average of the bigger positions side)
"PARTIAL" POSITIONS CLOSE:
-If the "Partial" positions it is also opened, need to calculate AFTER the first 2 positions, the net position to reach BREAKEVEN.
(could be more positions, but need to be minimum two)
The script also need to check what was the LAST opened position in "FIXED" positions sequence.
(IF it was BUY, and the "partial" close is happend with Sell Side(The Bigger Side), then close also THIS LAST BUY from the "Fixed SEQUENCE")
(IF it was SELL, and the "partial" close is happend with the BUY SIDE(The Bigger Side),then close also THIS LAST SELL from the "FIXED SEQUENCE)
The reason for that, I WANT TO STAY IN THE TREND DIRECTION, AFTER THE "PARTIAL" POSITIONS ARE CLOSED
The Script need to monitor:
-Magic number to collect the positions in the same "basket"
-The Weighted Average of the Buy positions
-The Weighted Average of the Sell positions
-How many Buy and Sell is open in the sequence at the moment.
-How many of them "FIXED", and there is any "Partial Position"?
-If Yes, then calculate Separate Weighted Average for the "partial" positions (buy & sell) (for the breakeven)
-What was the last position opened in the "FIXED SEQUENCE"?Buy or Sell?(Yellow arrow on the picture)
I Need Option for:
-Adjustable Magic number to manage the specific EA positions
-How many positions will be in the "Fixed" Positions sequence
-TP option for the "FIXED" positions to close in pips
-The Net position SIZE, TYPE & net PIPS printed on the chart in one line, like this>>>
(BUY > 0.34 > + - 23 Pips)
(adjustable color, font, wich window, & what position x, y value)
-Horizontal lines for >>Weighted Buy Average & the Weighted Sell AVERAGE (color & thickness adjustable)
See the attached picture.