Работа завершена
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Техническое задание
I need a Martingale EA that works for any currency pairs. Specification:
Available User Settings:
1. Initial Lot Size
2. Take Profit Pips
(Example: "3.5" = 35 points)
3. Pip Step
(The distance between each position. Example: "3.5" = 35 points)
4. Multiplier
(Example: "2" = 0.01, 0.02, 0.04, 0.08, 0.16, 0.32, etc...)
5. Trading Timer
(User to choose "True" or "False" for using a timer)
6. Start Time
(If trading timer enabled, this setting shall apply)
7. End Time
(If trading timer enabled, this setting shall apply)
8. Magic Number
(For EA to recognize and manage its own trades without interfering with manual trades)
9. Trade Comment
(The comment to be placed by EA at every trade)
10. Take Orders
(User can choose either "Buy" or "Sell". EA will trade all buys or all sells only.)
Scenario 1:
1. EA opens a buy position with initial lot size of 0.03. EA then modifies order to include TP.
2. When price move against the trade and bid price hits Pip Step, EA shall open a Buy Limit position with a lot size of 0.06. EA then modifies order to include TP.
3. Buy Limit position subsequently activates.
4. Price then rises and hit TP of the 0.06 position. 0.06 closes. EA shall automatically close position 0.03 as well.
Scenario 2:
1. EA opens a buy position with initial lot size of 0.03. EA then modifies order to include TP.
2. When price move against the trade and bid price hits Pip Step, EA shall open a Buy Limit position with a lot size of 0.06. EA then modifies order to include TP.
3. Buy Limit position subsequently activates.
4. When price move further against the trades and bid price hits Pip Step, EA shall open a Buy Limit position with a lot size of 0.12. EA then modifies order to include TP.
5. Buy Limit position subsequently activates.
6. Price then rises and hit TP of the 0.12 position. 0.12 closes. EA shall automatically close positions 0.06 and 0.03 as well.
Scenario 3:
1. EA opens a buy position with initial lot size of 0.03. EA then modifies order to include TP.
2. When price move against the trade and bid price hits Pip Step, EA shall open a Buy Limit position with a lot size of 0.06. EA then modifies order to include TP.
3. Buy Limit position subsequently activates.
4. When price move further against the trades and bid price hits Pip Step, EA shall open a Buy Limit position with a lot size of 0.12. EA then modifies order to include TP.
5. Buy Limit position not activated this time. Price reversed back before the ask price could hit the Pip Step.
6. Price then rises and hit TP of the 0.06 position. 0.06 closes. EA shall automatically close the 0.03 position and also cancel the unactivated 0.12 Buy Limit order.
About Trading Timer:
When setting is enabled, trading will be limited to the start and end time. If there is any open position at/after end time, EA shall continue to trade according to the strategy which includes opening new Pip Step positions. EA shall not start a new trade cycle after all positions are closed.
When setting is disabled, EA shall trade indefinitely.