Trabalho concluído
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Termos de Referência
Need a simple EA capable of performing an automatic buy/sell algorithm:
EA-Entries (colored entries are example variables):
1. Entry-, Stop-Loss and Take-Profit Settings |
||
|
Market-Buy Orders |
Market-Sell Orders |
Take-Profit (Distance in Pips from order) |
80 |
50 |
Stop-Loss (Distance as Price Level) |
1.30000 |
1.35000 |
Entry-Level (Price-Level) |
1.35000 |
1.30000 |
Trailing Stop-Loss (in Pips) |
20 (=Switched ON) |
0 (=Switched OFF) |
2. Algorithm Settings and Lot-Sizes |
||
|
Amount of market orders in the same direction |
Standard Lot Size of every order of the cycle |
0. cycle |
1 |
0.05 |
1. cycle |
2 |
0.02 |
2. cycle |
3 |
0.02 |
3. cycle |
3 |
0.06 |
4. cycle |
0 (=off) |
0.00 (=off) |
So essentially, in this example, as soon as the the EA is running in a chart, it should start buying 1 market order with lot size 0.05 (0. Cycle) when the market hits the price of 1.35000 with a Stop-Loss placed at 1.30000 and a Take-Profit of 80 Pips away from entry price, trailing Stop-Loss is switched on with 20 Pips trailing.
If this Position hits the Take-Profit right away, the EA should switch off completely and stop trading until turned on by the user again (success in the 0. Cycle)
If however the Position gets stopped out (failure in the 0.cycle), the algorithm should continue as adjusted in the settings: it will now open 2 selling orders with a lot size of each 0.02 (1. Cycle) at the given Entry-Price of 1.30000 and a Stop-Loss placed at 1.35000 and a Take-Profit of 80 Pips away from entry price, trailing Stop-Loss is switched off because I entered 0 pips trailing.
If these Positions hit the Take-Profit, the algorithm should stop, the EA should stop trading and switch off until switched on by the user again (success in the 1. Cycle).
If however the Positions get stopped out, the algorithm continues with the 2. Cycle, buying 3 orders with each 0.02 lots at the given price again with the same corresponding TP, SL and Trailing-SL in place indicated in the settings.
If Positions hit TP -> Success in the 2. Cycle -> EA switched off
If Positions hit SL again -> Failure in the 2. Cycle à Continue with 3. Cycle (3 market sell orders with given settings…. e.t.c)
The maximum amount of algorithms is 4. If the 4. Cycle is stopped out or TP is hit, the EA stops and shuts down. In this case the 4. Cycle is switched off indicated by the number zero. So the maximum number of cycles in this case is only 3 out of 4.