工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
Simple explanation.
This EA will use Average Directional Movement Index (ADX) value to determine which of the 3 martingale strategies it will use. For example, if ADX is 25 or less, it will use strategy 1. If ADX is above 50, it will use strategy 2. If the ADX is within the 2 values, it will use strategy 3.
For the initial trade, the EA will open either 1 buy or 1 sell trade based on the RSI value. For example, if RSI is 50 or less, it will open buy trade. If RSI is above 50, it will open sell trade.
====================================================================================================================================================================
Full requirements. Sorry for the long text as I want to explain clearer and fully.
1. The EA will use 2 indicators:
a. Average Directional Movement Index (ADX):
i. Period
ii. ADX <= 25 - Strategy 1
iii. ADX > 50 - Strategy 2
iv. Else - Strategy 3
b. Relative Strength Index (RSI):
i. Period
2. Strategy 1 (S1), Strategy 2 (S2) and Strategy 3 (S3) will be selectable by the EA when its value == True. When False, that option won't be considered by the EA.
3. THE STARTING POINT: As long as within the Start HH:MM and End HH:MM, Max Spread and Max Slippage, the EA is allowed to open the Initial Trade. The Start and End timings are not
applicable to the subsequent trades. The Max Spread and Max Slippage are still applicable to subsequent trades.
4. RSI [Buy <= 50 And Sell > 50, False Means Opposite] == True
5. For all the 3 Strategies below, EA will only open 1 Initial Trade, either Buy or Sell based on the RSI above(No. 4).
6. When ADX == Strategy 1:
a. Once the trade hits TakeProfitS1, go to c.
b. Once the trade hits DistanceS1 multiplied by DistanceMultiplerS1, the next SAME directional trade will be opened with LotMultipleS1 and keep on
opening till MaxLevelS1 is reached. When the whole series of trades hit TakeProfitS1 or StopLossS1, go to c.
c. RestS1 and then go back to THE STARTING POINT.
*EA will only open 1 trade per candle to prevent opening all level of trades during a spike.
7. When ADX == Strategy 2:
a. If the Initial Trade hits TakeProfitS2, open next SAME Direction trade with LotMultipleS2. Keep on opening the next trade with same direction and multiplying as long
as the trade hits TakeProfitS2. Once hits StopLossS2, go to c.
b. If the Initial Trade hits StopLossS2, open the next trade using OPPOSITE Direction with same lotsize. Keep on opening the next trade with alternate
directions and same lotsize till MaxTryS2 is reached. At MaxTryS2 and hits StopLossS2, go to c. Anytime the trade hits TakeProfitS2, go to c.
c. RestS2 and then go back to THE STARTING POINT.
8. When ADX == Strategy 3:
a. If the Initial hits TakeProfitS3, go to c.
b. If the Initial Trade hits StopLossS3, open the next trade using OPPOSITE Direction with LotMultipleS3. Keep on opening the next trade with alternate
directions and multiplying till MaxTryS3 is reached. At MaxTryS3 and hits StopLossS3, go to c. Anytime the trade hits TakeProfitS3, go to c.
c. RestS3 and then go back to THE STARTING POINT.