Idea by: Dmitry
mq5 code by: barabashkakvn
An EA based on technical indicators:
Transactions are made when the basic and signal MACD lines move upwards (for buying) and downwards (for selling). In this case, the indicators must be in the same direction at a certain number of bars: For ADX, it is ADX: bars interval; for MACD, it is MACD: bars interval.
In both cases, the main ADX line must move upwards and be above the value of 20 (ADX: minimum).
Closing a half of the position lot size (Take half the profit) and trailing have been realized.
Please note parameter Take half the profit. If you set Take half the profit for true, then the Take Profit of the position will not be placed (if even Take Profit is set for above zero). Instead, Take Profit will work as a step to take a half of the profit. The picture below demonstrates well how Take half the profit works:
Taking a half of the profit works only once. Then the position will be closed by triggering the Stop Loss.