I am quoting this post requesting some help. Can someone clear this up?
Lets try and figure out what this EA is doing?
If there are no open positions (opened by the EA), two oppositely directed positions with the "Lots" initial lot are opened with a stop loss equal to "Stop Loss", while take profit is not used. Stop loss moves using trailing ("Trailing Stop" and "Trailing Step" parameters are applied).
Ok so we get a hedged opening (1 long & 1 short) with a trailing stop on each side when the EA first starts... so far so good. One position will eventually close before the other one and there will be a loss in the other one. This can take some time usually one day.
I sometimes turn the EA off to capture profit and get a restart from the beginning. So this Hedged start can be expected in beginning when I turn the EA on each time. It takes one day for the EA to find its direction. The restart is good as it restores leverage and it allows the EA to naturally find what the market IS CURRENTLY DOING.
Trailing
Position's first modification reliably moves a stop loss to a breakeven or even a small profit. The subsequent modifications of Stop Loss increase the guaranteed profit.
So the stop loss that is used when first starting this EA is a trailing stop. One of the orders will reach a profit and the other order will be in a loss...this is the nature of a hedged opening. Anyways the profitable side of the hedge will get the trailing stop loss following the positive price direction and hopefully reach breakeven or more. below are some scenarios:
Two stop loss activation options are available afterwards:
Position has closed with a loss
In this case, we assume that the trend has reversed
So the trailing stop on the positive side of the hedge did not get enough follow through to get to breakeven.
Open a position with an increased lot (add "Number of minimum lots" to the volume of the remaining position) in the direction opposite to the closed one. For example, the unprofitable BUY position has been closed. Then open a SELL position with an increased lot. Thus, we obtain two positions in one direction.
Rather brilliant how Urdala determines direction...ON PRICE ITSELF...LOOK MOM NO INDICATORS.
Further on, it works only in the obtained direction:
So it pyramids
wait till the price leaves the least loss-making position by "Step" points in the loss-making direction and open a position with an increased lot (add "Number of minimum lots" to the volume of the least loss-making position) in the direction of existing positions (as you remember, we have one or several unidirectional positions). ?????
I am lost here
Position has closed with a profit (this is the position that was modified at least once)
Calculation of BUY and SELL positions, total profit on BUY and total profit on SELL, as well as searching for the least loss-making BUY and SELL position are performed within one call in the CalculateAllPositions function.
- 2.1. We assume that this is not a trend reversal, but a small rebound. Open a position with an increased lot in the direction of the closed one. For example, a profitable BUY position has been closed, then we open a BUY order with an increased lot. Thus, we obtain two positions in the same direction.
- 2.2. We try to apply trailing afterwards. In any case, one of the Stop Losses will work and we will return either to p. 1 or to p. 2.
Can someone tell me what this EA does? I can't figure it out. All of this is translated from Russian.
