Advanced Adaptive Grid EA

MQL4 Uzmanlar

Şartname

Project Overview: Advanced Adaptive Grid EA

This document outlines the development specifications for a sophisticated MQL4 Expert Advisor. The EA is designed to be a fully featured, institutional-grade trading tool employing an adaptive grid strategy with advanced risk management and user control.

Core Features

  1. Advanced Risk Control:

  • Equity Protection: Automatically closes all trades and halts trading if drawdown exceeds a user-defined percentage of the account balance.

  • Adaptive Lot Sizing: Automatically calculates lot sizes based on account equity, a fixed value, or a risk percentage per trade.

  • ATR-Based Stop Loss: Sets dynamic stop losses based on market volatility using the Average True Range (ATR) indicator.

  • Margin Limit: Prevents new trades if the used margin percentage exceeds a specified limit.

  1. Smarter Grid System:

  • Adaptive Grid Spacing: Dynamically adjusts the distance between grid orders using ATR or Bollinger Bands, widening the grid in volatile markets and tightening it in calm markets.

  • Asymmetric Spacing: Allows for different grid spacing for buy and sell trades.

  1. Intelligent Exit Logic:

  • Partial Profit-Taking: Closes a portion of a trade at a preliminary take profit level (TP1), letting the remainder run.

  • Equity-Based Trailing Basket: Trails a stop loss for the entire basket of trades (buys or sells) based on the total floating profit, locking in gains as the basket becomes more profitable.

  1. On-Chart Control & Transparency:

  • Quick Control Panel: Interactive buttons on the chart to immediately close all buys, close all sells, close all trades, or pause/resume new trading.

  • Expanded Dashboard: A comprehensive real-time display of account balance, equity, margin usage, floating P/L for buys and sells, current drawdown percentage, and EA status.

  1. Dynamic Market Adaptability:

  • Dynamic Slippage Handling: Automatically increases allowed slippage during periods of high volatility (e.g., news events) to ensure order execution.

  • News & Session Filters: Avoids trading during high-impact news events (requires external URL) and outside of specified trading sessions.

  1. Analysis & Optimization:

  • Detailed Trade Logs: Exports a detailed CSV log of every trading decision (order open, close, modify), including the reason, for easy performance review and optimization.

Part 1: EA Settings (Global extern Variables)

These inputs provide full control over the EA's behavior.

  • General Settings

  • MagicNumber: int - Unique identifier for the EA's trades.

  • TradeComment: string - Custom comment for trades.

  • Risk Management

  • LotSizing_Mode: enum - (EQUITY_BASED, FIXED_LOT, RISK_PERCENT)

  • Equity_Per_Lot: double - (e.g., 10000) Dollars of equity per 1.0 lot.

  • Lot_Size: double - Lot size to use(fixed,Equity percentage) 

  • Risk_Percent_Per_Trade: double - Risk % of balance for SL calculation if mode is RISK_PERCENT.

  • Max_Drawdown_Percent: double - The drawdown % of balance at which to close all trades and stop.

  • Stop_Trading_After_DD: bool - If true, the EA will not trade again after hitting the max drawdown.

  • Max_Margin_Usage_Percent: double - Maximum allowed margin level % before new trades are blocked.

  • ATR_SL_Period: int - Period for the ATR indicator for stop loss calculation.

  • ATR_SL_Multiplier: double - Multiplier for the ATR value to set the stop loss distance.

  • Grid Strategy

  • Grid_Spacing_Mode: enum - (ATR_BASED, BOLLINGER_BANDS, FIXED_POINTS)

  • Grid_ATR_Period: int - Period for the ATR indicator for grid spacing.

  • Grid_ATR_Multiplier_Buy: double - Multiplier for ATR to determine buy grid spacing.

  • Grid_ATR_Multiplier_Sell: double - Multiplier for ATR to determine sell grid spacing.

  • Grid_Fixed_Points: int - Grid spacing in points if mode is FIXED_POINTS.

  • Exit Strategy

  • Enable_Partial_Close: bool - Master switch for partial closing.

  • Partial_Close_TP1_Points: int - Profit in points to trigger the first partial close.

  • Partial_Close_Percent: double - Percentage of the trade to close at TP1 (e.g., 50.0).

  • Enable_Equity_Trail: bool - Master switch for basket equity trailing.

  • Equity_Trail_Start_Profit: double - Amount of profit in account currency to activate the trail.

  • Equity_Trail_Distance: double - Amount of profit to give back before the trail stops out the basket.

  • Filters & Slippage

  • Enable_Session_Filter: bool - Enable trading only during specific hours.

  • Session_Start_Hour, Session_End_Hour: int - Trading session hours (server time).

  • Base_Slippage: int - Normal slippage in points.

  • Volatility_Slippage_Multiplier: double - Multiplier for slippage during high volatility.

  • Volatility_ATR_Threshold: double - ATR value (as % of price) to trigger higher slippage.

  • Logging & Dashboard

  • Enable_CSV_Log: bool - Enable writing detailed logs to a CSV file.

  • CSV_Log_Filename: string - Filename for the log.

Part 2: Program Structure

  • OnInit(): Initializes the EA. Creates the on-chart dashboard and control panel buttons. Opens the CSV file for logging if enabled.

  • OnDeinit(): Cleans up resources. Deletes all chart objects and closes the CSV file.

  • OnTick(): The main execution loop. The logic must be ordered carefully:

  1. Check if trading is globally stopped.

  2. Check for and handle any button clicks from the control panel.

  3. Run all safety checks: Max Drawdown, Margin Limit, Session Filter.

  4. Run all exit logic for existing trades: Equity Trailing, Partial Closing.

  5. Run all management for existing trades: Apply ATR-based Stop Losses.

  6. Run logic for placing new grid orders if conditions are met.

  7. Update the on-chart dashboard with the latest information.

  • OnChartEvent(...): Handles user interaction with the on-chart control panel buttons.

Part 3: Helper Function Implementation

This EA will be composed of many specialized functions to keep the code clean and manageable.

  • Risk & Lot Size Functions: CheckMaxDrawdown(), CalculateLotSize(), IsMarginLevelOK().

  • Grid & Order Placement Functions: CalculateGridSpacing(), PlaceNewGridOrders().

  • Trade Management Functions: ManageOpenTrades(), ApplyATRStopLossToAll(), HandlePartialClosing(), HandleEquityTrailing().

  • Filter Functions: IsInTradingSession().

  • Dashboard & Control Functions: CreateDashboard(), UpdateDashboard(), CreateControlPanel(), HandleButtonClicks().

  • Logging Functions: InitializeCSVLog(), LogTradeAction(...).

  • Utility Functions: CloseAllByDirection(...), GetBasketProfit(...), GetCurrentDrawdownPercent().


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(256)
Projeler
319
29%
Arabuluculuk
34
26% / 65%
Süresi dolmuş
10
3%
Serbest
2
Geliştirici 2
Derecelendirme
(106)
Projeler
173
25%
Arabuluculuk
23
9% / 78%
Süresi dolmuş
16
9%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(15)
Projeler
19
16%
Arabuluculuk
5
40% / 40%
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(22)
Projeler
29
3%
Arabuluculuk
4
25% / 0%
Süresi dolmuş
3
10%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(52)
Projeler
66
41%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
7
11%
Serbest
6
Geliştirici 6
Derecelendirme
(509)
Projeler
977
74%
Arabuluculuk
27
19% / 67%
Süresi dolmuş
101
10%
Serbest
Yayınlandı: 1 makale, 6 kod
7
Geliştirici 7
Derecelendirme
Projeler
2
0%
Arabuluculuk
4
25% / 50%
Süresi dolmuş
1
50%
Serbest
8
Geliştirici 8
Derecelendirme
(10)
Projeler
16
19%
Arabuluculuk
3
33% / 67%
Süresi dolmuş
2
13%
Çalışıyor
9
Geliştirici 9
Derecelendirme
(14)
Projeler
19
11%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
5
26%
Serbest
10
Geliştirici 10
Derecelendirme
(13)
Projeler
13
38%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
8%
Serbest
11
Geliştirici 11
Derecelendirme
(12)
Projeler
12
17%
Arabuluculuk
2
0% / 50%
Süresi dolmuş
1
8%
Serbest
12
Geliştirici 12
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
13
Geliştirici 13
Derecelendirme
(111)
Projeler
139
43%
Arabuluculuk
9
33% / 44%
Süresi dolmuş
6
4%
Serbest
14
Geliştirici 14
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Geliştirici 15
Derecelendirme
(16)
Projeler
22
14%
Arabuluculuk
8
38% / 63%
Süresi dolmuş
6
27%
Serbest
16
Geliştirici 16
Derecelendirme
(271)
Projeler
553
50%
Arabuluculuk
57
40% / 37%
Süresi dolmuş
227
41%
Çalışıyor
17
Geliştirici 17
Derecelendirme
(156)
Projeler
197
59%
Arabuluculuk
10
80% / 0%
Süresi dolmuş
0
Çalışıyor
Yayınlandı: 1 kod
18
Geliştirici 18
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
2
0% / 0%
Süresi dolmuş
0
Çalışıyor
19
Geliştirici 19
Derecelendirme
(77)
Projeler
243
74%
Arabuluculuk
7
100% / 0%
Süresi dolmuş
1
0%
Serbest
Yayınlandı: 1 makale
20
Geliştirici 20
Derecelendirme
(3)
Projeler
1
0%
Arabuluculuk
5
0% / 100%
Süresi dolmuş
0
Serbest
21
Geliştirici 21
Derecelendirme
(24)
Projeler
30
13%
Arabuluculuk
12
0% / 75%
Süresi dolmuş
8
27%
Çalışıyor
22
Geliştirici 22
Derecelendirme
(43)
Projeler
66
12%
Arabuluculuk
12
58% / 42%
Süresi dolmuş
1
2%
Serbest
23
Geliştirici 23
Derecelendirme
(3)
Projeler
3
0%
Arabuluculuk
6
17% / 67%
Süresi dolmuş
0
Serbest
24
Geliştirici 24
Derecelendirme
(9)
Projeler
13
0%
Arabuluculuk
23
0% / 78%
Süresi dolmuş
4
31%
Serbest
25
Geliştirici 25
Derecelendirme
(3)
Projeler
1
100%
Arabuluculuk
3
0% / 100%
Süresi dolmuş
0
Serbest
26
Geliştirici 26
Derecelendirme
(298)
Projeler
477
40%
Arabuluculuk
105
40% / 24%
Süresi dolmuş
81
17%
Yüklendi
Yayınlandı: 2 kod
27
Geliştirici 27
Derecelendirme
Projeler
1
0%
Arabuluculuk
2
0% / 100%
Süresi dolmuş
0
Serbest
28
Geliştirici 28
Derecelendirme
(193)
Projeler
249
20%
Arabuluculuk
22
50% / 18%
Süresi dolmuş
0
Yüklendi
29
Geliştirici 29
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
30
Geliştirici 30
Derecelendirme
(10)
Projeler
14
43%
Arabuluculuk
0
Süresi dolmuş
3
21%
Serbest
Benzer siparişler
Hello, I need an Expert Advisor for both MT4 and MT5 based on a recovery/grid trading strategy. Strategy Logic: User manually opens either a Buy or Sell market order. Once the first trade is opened, the EA automatically places an opposite pending order at a user-defined distance. If the pending order gets triggered, the EA places another opposite pending order at the original order price. This cycle continues
📌 Project Overview: I need a full Smart Trade Management System for MetaTrader 4/5. This is a complete trading ecosystem, not a simple EA. 📌 Core Features: Smart Money Management (risk-based lot calculation) Advanced Trading Toolbox (TradingView-style drawing tools) Central Master Dashboard (risk, filters, account control) Multi-account monitoring (MT4/MT5 synchronization) Real-time monitoring (spread, equity
We are seeking an experienced MQL5 developer to build the Guardian EA, a focused circuit-breaker module for MetaTrader 5. Objective Protect capital during adverse moves by temporarily exiting positions at a defined drawdown threshold, while virtually tracking those positions as open. Re-establish the positions only when market conditions stabilize (via ADX) and drawdown recovers to a lower threshold. The goal is full
Hi basically I'm wanting an already made EA scalper that's constantly in and out of trades on the M1 time frame that has good risk management. It knows what it's doing. Most of its trades are profitable and that can start with £100. I am willing to pay up to £1000 for the right scalping bot. If you please have one and you're very confident in it, please allow me to use a live version to see how it does and if I'm
hello good evening All professional programmers! I'd like to request a special services I need a Gold and Silver trading bot like the one in the video, one that works on real accounts. My only request is that I don't pay any money until the bot is built and tested. Thank you very much please contact me as soon as possible for more information
https://youtu.be/mUoczuxL0XE?si=2IzxX4jhML_-4f47&nbsp ; ...... “Secret London Session CRT Model - Insane Accuracy | ICT Secrets.” The model is called London Twilight and focuses on quick scalps near the end of London session. Source summary notes it uses CRT + Turtle Soup + PO3/AMD , mainly between 3:00 AM and 5:00 AM EST/New York time . ( Video Highlight | AI Video Summarizer ) Give your MQL5 coder these rules
I'm looking for a buy sell indicator that places signals at candle close doesn't repaint. Looking for strategy too as part of this project. Will want to see it before I create the contract. Please don't send me stuff you know isn't good. If done well will pay well and it can turn I to a long term collaboration
Hello, professional programmers! I'd like to request a special service. I need a trading bot like the one in the video, one that works on real accounts. My only request is that I don't pay any money until the bot is built and tested. Thank you very much
Auto trading system on mobile with high probability win rate. Trades and auto trading system that works well on gold and forex, most important risk reward ratio. It must be 1:3 or more then that whenever possible
I want to buy proven profitable EA, any kind of strategy is considerable, working on any forex pairs or XAUUSD. I don't want to build from the scratch, so only apply if you already have profitable EA. Please send your EX4 file in advance with your application (MANDATORY), with additional information as below : - Pair and timeframe to use, minimum initial capital requirement, and so on - Type of EA (scalping, in day

Proje bilgisi

Bütçe
100+ USD
Son teslim tarihi
from 2 to 5 gün