Develop the Grid (with Pending orders) + Hedge EA for Currency Pairs and XAUUSD

指定

The discription attached below in English and Russian languages. Kindly note that I want to get the source code(.mq5 + .ex5) too, for self education. Thank you at advance

Grid Hedge 2026 EA Trading Expert Advisor

 

  • Development language: MQL5
  • Account type: Hedge
  • Trading on Forex pairs and XAUUSD
  • No indicators used
  • No time restrictions — the EA trades 24/7, with the option to limit or stop trading before important news
  • Currency: USD
  • Swap is not taken into account
  • Places only pending orders: BuyLimit - SellStop / BuyStop - SellLimit
  • Backtested in MT5

The EA should be fundamentally similar to the Magic Grid EA.
Reference:
https://www.mql5.com/ru/market/product/76546?source=Unknown


Main Parameters

 

This Expert Advisor places pending orders in a grid similar to Magic Grid. It uses TakeProfit/StopLoss. When launched, grids are created at equal distances relative to the current price. The EA always places only pending orders.

1.     Base Grid Lot = 0.01 (adjustable)

2.     Grids (Up & Down) = 10 (adjustable)

o    Total: 10 grids upward and 10 grids downward

o    Due to limitations on placing pending orders within one trading account, orders must be placed/removed gradually as the price moves

o    Number of grid levels = 10 (adjustable), with expansion capability when approaching grid boundaries (+10 levels in the direction of price)

3.     Grid Distance = 2000 (adjustable)

4.     Grid Take Profit = 2000 (adjustable)

o    Take Profit applies only to base grid orders

5.     Grid Stop Loss = 2000 (adjustable)

o    Stop Loss applies only to base grid orders

6.     Grid Deviation = 150 (adjustable, slippage)

7.     Magic Number = 9812345 (adjustable)

o    Used to allow running the EA on multiple instruments within one terminal


Risk Management

 

Risk management works on every tick if enabled.

8.     Risk Management = true (adjustable)

9.     Target Profit = 1000.0 (adjustable, % of equity)

o    When reached: closes all orders and trades, fully stops trading, and sends a notification

10. Max Drawdown = 80.0 (adjustable, % of equity)

  • When reached: closes all orders and trades, fully stops trading, and sends a notification

11. Extra Notification for Equity Drawdown = true (adjustable)

12. Extra Notification for Equity Drawdown Percentage = 70.0 (adjustable)


First Stage Compensator Logic

 

The mechanism called the first-stage compensator places additional pending BuyStop or SellStop orders to support the current price direction.

  • Initially places orders on grids according to input parameters at EA start
  • When active orders show an imbalance in buy/sell lots, restrictions on compensator order placement are activated
  • Unlike the main grid:
    • Buy pending orders are placed only above the current price
    • Sell pending orders are placed only below the current price
  • Due to account limitations, pending orders are placed gradually (only inactive ones are removed) as price moves

First Stage Compensator Parameters

 

(No TakeProfit/StopLoss — only a two-stage Trailing Stop)

13. First Stage Compensator = On/Off (adjustable)

14. First Stage Compensator Mode = limited / unlimited (adjustable)

  • Sell restriction formula:
    (sum of buy lots below current price − sum of sell lots below current price) / grid lot ≤ -6
    • If ≤ -6 → sell pending compensators above current price are NOT placed (to prevent increasing drawdown)
  • Buy restriction formula:
    (sum of buy lots above current price − sum of sell lots above current price) / grid lot ≥ 6
    • If ≥ 6 → buy pending compensators below current price are NOT placed (to prevent increasing drawdown)

15. First Stage Compensator Lot = 0.01 (adjustable)

  • Can be fixed or dynamic:
    • Fixed: standard (adjustable)
    • Dynamic: calculated as follows:
      (sum of active buy lots − sum of active sell lots) / lot difference divisor × Base Grid Lot
      • If result > 0 → sell compensator lot = result
      • If result < 0 → buy compensator lot = absolute value
      • If result = 0 → lot = Base Grid Lot

16. Lot Difference Divisor = 3 (adjustable)

17. First Stage Compensator Mode = each_grid
(adjustable, struct Mode = each_grid, second_grid, third_grid)

18. Trailing Stop Start At = 2000 (adjustable)

  • When a compensator trade moves 2000 points into profit, the first trailing stop is activated

19. Trailing Stop Placed At = 1000 (adjustable)

  • The trailing stop remains fixed

20. Trailing Stop Additional Moved To = 4000 (adjustable)

  • Additional shift at profit = 2 × Grid Distance

 


ファイル:

ZIP
TZ_2026.zip
440.5 Kb

応答済み

1
開発者 1
評価
(393)
プロジェクト
549
40%
仲裁
30
57% / 3%
期限切れ
57
10%
パブリッシュした人: 11 codes
2
開発者 2
評価
(5)
プロジェクト
10
50%
仲裁
1
100% / 0%
期限切れ
2
20%
仕事中
パブリッシュした人: 6 codes
3
開発者 3
評価
(265)
プロジェクト
597
35%
仲裁
64
20% / 58%
期限切れ
147
25%
パブリッシュした人: 1 article, 22 codes
4
開発者 4
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
5
開発者 5
評価
プロジェクト
1
0%
仲裁
0
期限切れ
1
100%
6
開発者 6
評価
(4)
プロジェクト
4
0%
仲裁
4
25% / 75%
期限切れ
1
25%
7
開発者 7
評価
(357)
プロジェクト
428
54%
仲裁
20
55% / 15%
期限切れ
29
7%
仕事中
8
開発者 8
評価
(555)
プロジェクト
642
33%
仲裁
41
41% / 46%
期限切れ
11
2%
多忙
類似した注文
Нужен простой советник для МТ5, работающий по принципу и аналогии с работой FxGrid 1.6 в МТ4. Советник открывает ордера в выбранном направлении с возможностью усреднения (лотность, коэффициенты, расстояния межу ордерами настраиваются как заранее, так и по ходу работы советника). Как только закрыт ордер (по с/л или т/п), тут же открывается (или нет) следующий ордер в том же направлении
Нужен советник, для МТ 4, зарабатывающий не менее 10 процентов в месяц, при тестировании в любой период, на 3-5 валютных парах, можно больше, с просадкой не более 20 процентов. Необходим стоп-лосс, чтобы не было риска потери депозита. Готов обсудить любые предложения или дополнения в ходе обсуждения заказа
AO - при пересечении уровня 0 в какую-либо сторону открывать соответствующий ордер. RSI - при пересечении отметки 30 пунктов снизу открывать ордер на покупку, при пересечении отметки 70 пунктов сверху открывать ордер на продажу. Стратегии не зависят друг от друга. Предустановка размеров ТП и СЛ, предустановка уровней ТС
Необходима таблица с параметрами:тф,частота изменения цены за данный тф,ход цены за данный тф.Возможность выгрузки данной сформированной за выбранный период инфо.1 мин,3 мин,6 мин,20 мин …. День,неделя,месяц.Любой период который мне надо будет анализировать
Основная идея советника заключается в использовании коррелирующих валютных пар для выравнивания отрицательного баланса. Изначально запускаются 4 пары, разделенные на 2 блока. В каждом блоке 2 пары, каждая из которых открыты разнонаправленно buy\sell с установленными заранее уровнями TP. Например: в одном блоке 2 пары EUR\USD buy и sell, во втором блоке 2 пары USD\CHF buy и sell. TP устанавливается в каждом блоке
Требуется создать советник на основе разворотных паттернов, используя дополнительные индикаторы такие как скользящее среднее, отклонение от скользящей средней, угол наклона скользящей средней. Возможно будет добавлено что то еще по ходу работы
Суть ТС:Приход в POI старшего тф, вход в позицию на младшем тф Анализ графика начинается всегда со старшего тф. Должен быть понятный контекст для работы. Активы: EURUSD, XAUUSD POI старшего таймфрейма: Liquidity (1M, 1W, 1D, 4H, 1H) Imbalance (1M, 1W, 1D, 4H, 1H) Order Block (1M, 1W, 1D, 4H, 1H) HTF Fractals (1M, 1W, 1D, 4H, 1H) Всегда дожидаться цену в POI старшего таймфрейма. Вход в позицию: Слом LTF структуры на

プロジェクト情報

予算
100 - 200 USD
締め切り
最低 5 最高 10 日

依頼者

出された注文1
裁定取引数0