EAjfinfx
- Эксперты
- Версия: 1.0
- Активации: 10
Explanation of an Expert Advisor (EA) used for gold trading:
1. Buy condition: Once the EA is activated, after one candlestick, if the first candlestick is a gain, the next candlestick will open a buy position. The ADX indicator must be greater than the specified value to open the position. If the ADX indicator is less than the specified value, the position will not be opened.
2. After that, set the take profit and stop loss points that the client deems appropriate.
3. If the next candlestick does not reach the take profit and stop loss points, the take profit and stop loss values will remain in place until they are reached. Only then will the set take profit and stop loss values disappear.
4. The position opening depends on the InpCooldownBars setting, which determines how many candlesticks are needed before opening a position. However, the ADX indicator must be greater than the specified value to open a position. If the ADX indicator is less than the specified value, the position will not be opened.
5. If the take profit point is reached, open the position on the specified candlestick determined by the InpCooldownBars value. You can set how many subsequent candlesticks are needed to open the position.
6. If a position is opened and the stop loss point is reached, the InpMaxConsecutiveSL value can be set to determine the next candlestick for opening a position. 6. Determine how many more candlesticks are needed for the stop-loss order to be triggered, as per the client's request, before stopping the trade.
7. If the stop-loss order is not reached, the next candlestick will automatically exit the buy position, but the take-profit and stop-loss values will remain in place.
8. For the next position, the candlestick must pass the set InpCooldownBars value before opening a new position according to the conditions in point 1.
9. For the sell side, after starting the EA, if the first candlestick goes down, the next candlestick will open a sell position, provided the ADX indicator value is greater than the specified value. If the ADX indicator value is less than the specified value, the position will not be opened.
10. After that, set the take-profit and stop-loss points that the client deems appropriate.
11. If the next candlestick does not reach the take-profit and stop-loss points, the take-profit and stop-loss values will remain in place until they are reached. Only then will the set take-profit and stop-loss values disappear.
12. The opening of a position depends on the InpCooldownBars setting, which determines how many candlesticks are needed before opening the position. However, to open a position, the ADX indicator must be greater than the specified value. If the ADX indicator value is less than the specified value, no position will be opened.
13. If the take profit point is reached, open a position on the specified candlestick using the InpCooldownBars value. You can set how many candlesticks after that point the position will be opened.
14. If a position is opened and the stop loss point is reached, the InpMaxConsecutiveSL value can be set to determine how many candlesticks after that point the position will be opened and how many candlesticks after that point the stop loss will be triggered, as desired by the client, before stopping the trade.
15. If the stop loss point is not reached, the next candlestick will automatically exit the sell position, but the take profit and stop loss values will remain.
16. For the next position, the candlestick must pass the InpCooldownBars value set before opening a new position according to the conditions in point 9.
Note: If the value after that candlestick is lower than the specified ADX indicator value, no position will be opened. Only when the ADX indicator value is higher than the specified value will a position be opened. This will depend on whether the previous candlestick was rising (open buy) or falling (open sell). If any time period exceeds the InpMaxSpreadPoints value, no position will be opened.
Seting mean
input double InpLots = 0.01; // Lot size
input int InpTakeProfitPoints = 20; // Take Profit in points
input int InpStopLossPoints = 100; // Stop Loss in points
input int InpCooldownBars = 10; // Bars to wait before next cycle
input int InpMaxConsecutiveSL = 3; // Consecutive SL limit
input ulong InpMagicNumber = 20260704; // Magic number
input int InpDeviationPoints = 20; // Max price deviation in points
input bool InpUseADXFilter = true; // Use ADX filter (block trading if ADX < threshold)
input int InpADXPeriod = 14; // ADX period
input double InpADXThreshold = 25.0; // Minimum ADX main value required to trade
