An Expert Advisor based on the "Two sides of the martingale" strategy. Martingale is a betting management system. This type of strategy is very popular in roulette. This principle is also widely used in Forex. After starting the EA we open two opposite deals - BUY and SELL. The initial stop loss should be equal to the take profit. For example: StopLoss = 100, TakeProfit = 100.
In this case, when stop loss triggers on one order, we get the activation of take profit on the second one. Thus the result is 0. Then the next series of deals is opened, but on the following condition. The volume of the next deal of the same type is equal to Lot * martingale. And then we cover the loss of the first deal and earn a profit of 100 points. On the example of the Expert Advisor:
- Magic - magic number.
- StopLoss - the stop loss value, 0 - not used.
- TakeProfit - the take profit value, 0 - not used
- Slippage - slippage
- MarketWatch - trading mode. If MarketWatch = true, first positions/orders without stops are placed, and then they are modified (for some brokers).
- Lots - fixed lot.
- Martin - the coefficient of the martingale for the deal following the losing one. If 1, then it is not used.
- TrailingStopUSE - use of the trailing stop.
- IfProfTrail - use the no-loss mode only for profitable positions.
- TrailingStop - trailing distance, 0 - the minimum allowed.
- TrailingStep - trailing step.