Specification
all the details are in attached file.
operating system
Type cloture : simple/multiple
1- If Type cloture is simple : the first position when it touches the hedge, it closes, at the same time, it opens a second position with the lot hedge 1.
if the hedge 1 touches the entry point, the hedge 2 will be opened , but the hedge 1 will be close at the same time , and so on
To complete this series of hedge , one condition of these 03 must be valide :
1- If the price touches the TP
2- the profit must be equal to the closing price (in this case we calculate the profit as follows :::: profit = current profit - (the loss of the entry position + the loss of the hedge position 1 + the loss of hedge position 2 + ..3..4 ......) don’t forget swap and commission.
3- the position is closed manually
I will have for exemple 5 positions but only one is open
1 -The entry (buy) position with entry lot ---- close if the hedge is touch
2-the hedge 1 (sell) position with Lot hedge 1 ----- close if the hedge is touch
3-the hedge 2 (buy) position with Lot hedge 2 ----- close if the hedge is touch
4-the hedge 3 (sell) position with Lot hedge 3 ----- close if the hedge is touch
5-the hedge 4 (buy) position with Lot hedge 4 ----- close if the TP is touch
2- If Type cloture is multiple : when the position touches the hedge, it will not be closed, but it will remain active, and a second will be open with lot hedge 1 and so on .
To close all of this positions , one condition of these 03 must be valide :
1- If the price touches the TP
2- the profit must be equal to the closing price (in this case we calculate the profit as follows :::: profit = wining positions – losing positions ( don’t forget swap and commission )
3- if a position of this series is closed manually
I will have for this exemple 5 positions
1 -The entry position with entry lot (buy)
2-the hedge 1 position with Lot hedge 1 (sell)
3-the hedge 2 position with Lot hedge 2 (buy)
4-the hedge 3 position with Lot hedge 3 (sell)
5-the hedge 4 position with Lot hedge 4 (buy)
Auto Trading : Yes/Non
if auto trading is NO, the EA only manages positions that i activate by entering on the market or buy a ordre limite .
the role of EA is only the management of positions in case of loss by the system hedge
if auto trading is Yes
the EA automatically enters in position when the price crosses the moving averge that I choose (EMA - SMA ...), then manages the position with the hedge if the price goes in the loss sens )
NB : each system of hedge begins with a position, either manual or automatic, in any case, the EA manages this position with an ID, to allow me to open several positions on the same pair and to be able to manage each independent to the other.