The Expert Advisor’s trading strategy is based on the price crossing the moving average. The algorithm includes the following functions:
- trailing the stop loss order when the specified profit is reached;
- change in the position volume depending on the balance change;
- sitting out unprofitable trades;
- closing unidirectional break-even trades;
- limit loss on open trades;
- flat filter.
- Take profit-the size of the take profit order;
- Stop loss – the size of the stop loss order;
- Start trailing if profit > (pips) – trawl the stop loss order if the profit on the position is greater than the set value, if 0-the trawl is disabled;
- Start with lot – the initial volume of the position, increases in proportion to the change in the balance;
- MA – the period of averaging the moving average;
- MA Shift-the offset of the moving average relative to the current bar, can not be less than zero;
- Bars amount-flat filter, the number of bars below/above the MA line;
- Close losses-close unprofitable trades, yes/no. If “no”, then when the reverse signal appears, the take profit of the previous losing trade will be transferred to the opening price of the trade – to breakeven, and if the previous trade is profitable, it will be closed;
- … maximum deals – the maximum allowed number of non-closed unprofitable trades. Trades will be opened using reverse signals until this limit is reached.;
- Close deals if total loss > ( % ) > – close all open trades if the loss on them is greater than the specified one.
- Close couple orders by breakeven-close unidirectional trades at breakeven, yes/no;
- Slippage (in pips) – acceptable amount of slippage when opening a trade;
- Magic number – the magic number of transactions.
[spoiler title=”Read More…”]
The expert Advisor was tested on the history in the interval from May 1 to October 1, 2016, all ticks, M30. The test results are shown in the figures.
For the EURUSD M30 pair, the stop loss order is trailed, losses are not closed –
[/spoiler]