The EA places two opposite pending orders, STOP or LIMIT depending on its input parameters. Orders are modified following the price based on the timer in seconds. When one of the pending orders triggers, the other one is deleted. If the EA is running on several currency pairs with the same magic number, all inactive pending orders are deleted, and the EA then works only with the pair, where a position was opened. If different magic numbers are used, the EA works with each of the pairs separately, i.e. when an order triggers for one currency pair, pending orders of other currency pairs are not deleted.
Opening New Orders
If the price moves in the direction opposite to the open position, a pending order will be placed at a preset distance to follow the price. A pending order will be modified only if the price continues to move in the wrong direction. Thus, we achieve the most favorable positions of new deals. Multiple positions can be opened at one price depending on the EA settings and the price behavior.
If one position is in the market. The first modification of stop-loss is the breakeven level, then point-based trailing stop is activated and works till a distance specified in the EA settings “TrailingStop”. After passing the distance, trailing by previous Hi-Lows of bars is enabled. The timeframe and the number of bars for finding the extreme values are specified in the EA settings. The switching trailing stop allows to maximize the profit.
If several positions are in the market. All deals are closed by a common profit. Some deals can be closed with a small loss, but the total profit of closed orders is always greater than the loss. All positions are closed by trailing stop. Position closing prices may differ, depending on the speed of order execution on the broker side.
- STOPLOSS– stoploss points;
- TAKEPROFIT – takeprofit points;
- BASKET_PNL – close all or one order at a time;
- MULTIDIRECTIONAL_PNL – grid of orders separately for buy and sell or both buy and sell together;
- Maximum_ORDERS – maximum number of trade;
- BalanceLot – calculation of traded lot based on balance;
- ManualLot – traded lot, if BalanceLot = 0;
- NextLotRatio – lot ratio, if NextLotRatio = 1, then lot does not change;
- MagicNum – magic number for orders;
- FirstTypeOrder – the type of the first two orders;
- DistanceFirstOrder – distance from the price to place the first two orders;
- DistanceNextOrder – distance from the price to place the next orders;
- NextStepOpenOrders – the step of the next orders, distance from an open order;
- TimerModifyFirstOrder – modification of the first two orders, set in seconds;
- TimerModifyNextOrder – modification of the next orders, set in seconds;
- MaxAttempts – maximum number of attempts to open an order;
- DelaySeconds – pause between attempts in seconds;
- Slippage – maximum price slippage;
- BreakevenStart – the number of points to move s position to breakeven;
- BreakevenStep – the distance to place breakaeven at;
- TrailingStop – the number of points after which the Hi-Low trailing is activated;
- TrailingStart – the number of points to start trailing;
- TrailingStep – trailing stop step.
- TimeFrame – the timeframe to search for the high/low price;
- BarCount – number of bars to search for extremums;
- IndentHiLow – a distance from the Hi-Low price to set a stop loss.
- ShowInfo – display/hide information on the trading;
- TextColor – displayed data color.