Spécifications
Alright, let's say we have the following trading pairs: USD/JPY, CAD/CHF, GBP/CHF, GBP/CAD, AUD/NZD, USD/CAD, NZD/CAD, CAD/JPY, GBP/NZD, GBP/AUD, USD/CHF, NZD/USD, EUR/CHF, NZD/CHF, CHF/JPY, NZD/JPY, AUD/CAD. We want our algorithm to work on any open trade among these pairs. We can check which trades are open by looking at the positions.
The algorithm should have a manual option to start and stop. Additionally, we need to specify the number of points at which the algorithm will be activated if the trade goes against us. For example, let's say we took a trade in USD/JPY at a price of 143.566. If the trade starts going against us, we want the algorithm to activate when the price reaches 143.666. We should add the spread of USD/JPY at that time to the activation price. This allows the price to move upward. When the price comes down, the algorithm should place a Stop Limit order in our position, adding a sell lot. If the price goes up again, another lot should be added. The first added lot should have a profit target specified for an upward move. Only that lot should exit when it reaches the target.
If the trade exits when it reaches the target, the algorithm should stop working. However, if the trade gets stopped out, the algorithm should place a Stop Limit order at the specified activation point. If the market continues to move up or slightly down and then up again to a specific level, another Stop Limit order should be placed. This process should continue until we reach the target for the first added lot or the specified number of points above the initial entry.
We will specify the number of points above the initial entry where the orders will be placed. You will find out the spread value in the software. For example, if we specify placing the Stop Limit order when the price moves 0.100 points against us and the spread for USD/JPY at that time is 0.011, the order should be placed when the price moves 0.111 points in the opposite direction.
Please confirm if this accurately represents your algorithm in simplified English. Once confirmed, I will proceed with converting it into the MQL5 coding language.