Работа завершена
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Техническое задание
Hi,
I would like simple EA- robot for MT5 platform.
On the selected time frame and currency pair I would like for the positions to open regarding the last candle. Meaning if the last candle was red, then at the beginning of the new candle we open SELL position and if the candle at the end of the time frame is green, then the buy is executed at the beginning of the new candle at selected time frame.
So in theory if we use robot on H1 time frame of the selected currency pair, robot would open max 24 trade positions in a day.
Opened position is closed :
At take profit –OR-
Trailing stop –OR-
Stop loss –OR-
At the end of the traded candle (selected time frame);
Double down strategy
If the closed trade was in loss at the closing the next position that opens doubles the size of lots for the next trade. For example we opened sell position (0,01 LOT) and it hit the selected stop loss. Then on the next position opening we would trade with 0,02 LOT and if that lost again we open at next candle 0,04 LOT, and so on until the opening position is a winner and then the new trade will again use the minimum LOT selected in the EA settings.
EA settings:
Lot - Fix lot
Double down strategy on/off
Time to Start Hour - Start hour to open trades
Time to Finish Hour - End hour to open trades
Magic - Magic number
Trailing On Off - Trailing stop on/off
Trailing Start - Trailing start in points
Trailing From - Trailing from in points
Trailing Step - Trailing step in points
TakeProfit - Take Profit in points
StopLoss - Stop Loss in points
Please deliver nicely structured and well commented code, as this is first phase of the robot.
Supply also the source code.
Thank you for your time.