Trabajo finalizado
Tarea técnica
Instead of using of using a fixed stop loss, why risk mitigation approach is to partially close part of a position and move adjust the remaining positions to breakeven. This approach works in most scenarios but fails when the position does not return to the breakeven level.
In this scenario I would like to use the profits from my remaining trades to trim back by position in a losing one.
As a result I would like the attached EA to perform the following:
1) If Dynamic Profit2 (Line 674) - essentially measures the floating loss and profit. When this reaches a certain level of drawdown (e.g. $250), for a symbol and a side e.g. US30 Shorts. Then this time will be recorded and so will the current balance of the account.
Scenario 1:
Lets say the drawdown event (i.e. a symbol and side = $250 drawdown and 1 Lot) was the 3rd January 2022 at 07:01 and the balance was $10,500.
All the closed profit that has been made on the account from that point onwards will be used to Partially close the position in drawdown.
For example, let us say that other symbols have have a profit of $100 (between 7:01 and 9:00), then that equivalent amount will be used to partially close the US30 sell position (that was at $250 drawdown at 7:01). Let's say that at 9:00 the floating drawdown on US30 is $300, then the position size (originally 1.0 Lots - we can assume this did not increase), will not be reduced to 0.66 Lots.
Note: this scenario will occur each time a trade has closed in profit.
The time will not refresh every time the drawdown on US30 reaches $250 dollars (there will be a pause period for X minutes so that it does not refresh too much).
Scenario 2:
Let us say that it is 7:01 US30 Shorts are in $250 drawdown and the pause period (i.e. the pause until the drawdown needs to be checked again) is set to 120 minutes. And using the process the lots on US30 has reduced to 0.66 Lots. During this period 7:30 there is another position USDCHF that has just reached the drawdown level of $250. In this scenario, the drawdown reduction process will be carried out on the symbol that has more recently hit the drawdown / or the one that has the highest drawdown (whichever is easier to code).
The Partial Close will keep happening until the drawdown on the symbol reaches a certain level e.g. $100.
Note:
Please check the screenshot provide for a visual representation