Auftrag beendet
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spezifikation
Hello!
I would like a customisable Trading robot / EA that follows a simple moving average and uses a customisable martingale system.
Specifically the user defined input variables are:
1. The number of periods used in the simple moving average (SMA)
2. The size in pips for the take profit (TP)
3. The size in pips for the stop loss (SL)
4. Whether new positions are opened converging towards or diverging away from the SMA
5. The sequence of lot sizes to be used (no more than 10 values needed)
6. Whether, in the event of the final lot size in the sequence being used and the trade still failing, to continue trading restarting the lot size sequence from the first lot size, or to cease trading until a trade would have been successful, and then restart trading using the first lot size in the sequence.
The program is to do the following:
1. The EA is to work in the timeframe of the chart the robot is attached to, and must be able to work on multiple markets at once.
2. When starting, open a new order.
3. When opening a new order, the EA compares the current price with the SMA of close prices (user input 1).
4. The EA is to then either open a buy or sell position depending on whether it is set to converge or diverge from the average (user input 4).
5. Unless the previous order was ended by its Stop loss, this new order is to use the first lot size in the given sequence (user input 5), with the EA attaching the specified TP and SL levels (user inputs 2 and 3).
6. If the Take profit is triggered then a new position is to be opened as soon as possible, as per steps 3, 4 & 5- with the lot size restarting from the first value.
7. If the Stop loss is triggered then a new position is to be opened as soon as possible, as per steps 3, 4 & 5, however the next lot size in the sequence is to be used (user input 5).
8. If the last lot size in the sequence was used and the trade was ended by its Stop loss, then depending on the setting of user input 6, the EA is to either:
a) Stop opening positions and monitor the market (trading with 0 lots as it were) and recommence once a successful trade would have gone through, or
b) Continue opening positions restarting from the first lot size in the sequence.
I would like the source code for this to be provided.
If you have any questions / require any clarification please do send me a message.
Many thanks!