Tâche terminée
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spécifications
Above is just a basic example or you could implement better based on the below information, by including some of the settings on the panel to make it easier.
Setting:
MA1: Period 5 - Linear Weighted - High (default)
MA2: Period 10 - Linear Weighted - High (default)
MA3: Period 5 - Linear Weighted - Low (default)
MA4: Period 10 - Linear Weighted - Low (default)
Magic number - 29 default
Lot - option based on fix lot or % or balance (Fix lot default)
Fix lot - 0.01 default
% Balance - 2 default
Stop loss in pips - 20 default
TP adjustment in pips - 1 default
Buy Sell - Closest or farthest or both (closest - default) - eg. if buy is pressed, the EA should buy when price is at MA1 (being MA1 price > MA2) or at M2 when M2 price > MA1, if both then EA should place an order when it has reached MA1 and another when it reaches MA2.
Closest TP - yes or no - yes default (eg. for buy with yes the TP should be at MA1 when MA1 < MA2 or at MA2 when MA2 < MA1 - and for sell for yes option, the TP should be MA3 when MA3 > MA4 or at MA4 when MA4 > MA3)
When buy is pressed:
EA should wait until price is either touch MA3 or MA4 (see 'Buy Sell') then execute buy order the tp is dynamic MA1 or MA2(see 'Closest TP') (ea should adjust every closed candle)
Once a buy has been executed then EA should not buy or looking for another opportunity unless buy is pressed again.
When sell is pressed:
EA should wait until price is either reach MA1 or MA2 (see 'Buy Sell') then execute sell order the tp is dynamic MA3 or MA4 (see 'Closest TP') (ea should adjust every closed candle)
Once a sell has been executed then EA should not sell or looking for another opportunity unless sell is pressed again.
If TP adjustment is not 0, then the EA should calculate the TP as closest TP MA value (see 'Closest TP') - TP adjustment for buy and MA value + TP adjustment for sell
NB: if closest TP is yes then TP is based on the closest MA (ea should adjust every bar) for buy should be either MA1 or MA2
if it is no then it should set the TP based on the farther MA (should be adjusted every bar) for sell should be either MA3 or MA4