The Brain Behind It: Sergey Rashevskiy.
Code Wizard: barabashkakvn.
How the Strategy Works
When there are no open trades initiated by the EA, it opens two opposing positions with an initial lot size of Lots. A stop loss is set at Stop Loss, while take profit is not utilized. The stop loss will trail the market using the Trailing Stop and Trailing Step parameters.
Trailing Explained
The first modification of a position's stop loss ensures that it moves to breakeven or even into profit. Subsequent updates to the stop loss boost your guaranteed profit.
Afterward, there are two scenarios for stop loss activation:
- 1. If a position closes at a loss:
- 1.1. Here, we assume the trend has reversed. Open a new position with a larger lot size (add Number of minimum lots to the remaining position's volume) in the opposite direction. For example, if a losing BUY position has been closed, then a SELL position should be opened with an increased lot size. This results in two positions in the same direction.
- 1.2. Moving forward, we only trade in the established direction: wait until the price moves away from the least loss-making position by Step points in the direction of the loss, and then open a position with an increased lot size (add Number of minimum lots to the least loss-making position) in the direction of the current positions.
- 2. If a position closes with a profit (having been modified at least once):
- 2.1. We consider this a minor pullback rather than a trend reversal. Open a new position with a larger lot size in the direction of the closed profitable position. For example, if a profitable BUY position has been closed, we’ll open another BUY order with an increased lot size. This means we now have two positions in the same direction.
- 2.2. We aim to apply trailing next. Regardless, one of the stop losses will trigger, leading us back to either scenario 1 or scenario 2.
The EA calculates the BUY and SELL positions, the total profit for each, and identifies the least loss-making BUY and SELL positions all in one go through the CalculateAllPositions function.
Inputs
- Lots - initial trade volume
- Number of minimum lots - the increment by which position volume changes
- Stop Loss (in pips)
- Trailing Stop (in pips)
- Trailing Step (in pips)
- Step - initial distance between opposing positions
- Minimum nearest (in pips) - minimum spacing in a series of positions
- Magic number - unique identifier for the EA
Comments 0