Advanced Adaptive Grid EA

MQL4 エキスパート

指定

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().


ファイル:

応答済み

1
開発者 1
評価
(256)
プロジェクト
319
29%
仲裁
34
26% / 65%
期限切れ
10
3%
2
開発者 2
評価
(106)
プロジェクト
173
25%
仲裁
23
9% / 78%
期限切れ
16
9%
仕事中
3
開発者 3
評価
(15)
プロジェクト
19
16%
仲裁
5
40% / 40%
期限切れ
0
4
開発者 4
評価
(22)
プロジェクト
29
3%
仲裁
4
25% / 0%
期限切れ
3
10%
仕事中
5
開発者 5
評価
(52)
プロジェクト
66
41%
仲裁
1
0% / 100%
期限切れ
7
11%
6
開発者 6
評価
(509)
プロジェクト
977
74%
仲裁
27
19% / 67%
期限切れ
101
10%
パブリッシュした人: 1 article, 6 codes
7
開発者 7
評価
プロジェクト
2
0%
仲裁
4
25% / 50%
期限切れ
1
50%
8
開発者 8
評価
(10)
プロジェクト
16
19%
仲裁
3
33% / 67%
期限切れ
2
13%
仕事中
9
開発者 9
評価
(14)
プロジェクト
19
11%
仲裁
1
0% / 100%
期限切れ
5
26%
10
開発者 10
評価
(13)
プロジェクト
13
38%
仲裁
1
0% / 100%
期限切れ
1
8%
11
開発者 11
評価
(12)
プロジェクト
12
17%
仲裁
2
0% / 50%
期限切れ
1
8%
12
開発者 12
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
13
開発者 13
評価
(111)
プロジェクト
139
43%
仲裁
9
33% / 44%
期限切れ
6
4%
14
開発者 14
評価
(1)
プロジェクト
1
0%
仲裁
0
期限切れ
0
15
開発者 15
評価
(16)
プロジェクト
22
14%
仲裁
8
38% / 63%
期限切れ
6
27%
16
開発者 16
評価
(271)
プロジェクト
553
50%
仲裁
57
40% / 37%
期限切れ
227
41%
仕事中
17
開発者 17
評価
(156)
プロジェクト
197
59%
仲裁
10
80% / 0%
期限切れ
0
仕事中
パブリッシュした人: 1 code
18
開発者 18
評価
(1)
プロジェクト
1
0%
仲裁
2
0% / 0%
期限切れ
0
仕事中
19
開発者 19
評価
(77)
プロジェクト
243
74%
仲裁
7
100% / 0%
期限切れ
1
0%
パブリッシュした人: 1 article
20
開発者 20
評価
(3)
プロジェクト
1
0%
仲裁
5
0% / 100%
期限切れ
0
21
開発者 21
評価
(24)
プロジェクト
30
13%
仲裁
12
0% / 75%
期限切れ
8
27%
仕事中
22
開発者 22
評価
(43)
プロジェクト
66
12%
仲裁
12
58% / 42%
期限切れ
1
2%
23
開発者 23
評価
(3)
プロジェクト
3
0%
仲裁
6
17% / 67%
期限切れ
0
24
開発者 24
評価
(9)
プロジェクト
13
0%
仲裁
23
0% / 78%
期限切れ
4
31%
25
開発者 25
評価
(3)
プロジェクト
1
100%
仲裁
3
0% / 100%
期限切れ
0
26
開発者 26
評価
(298)
プロジェクト
477
40%
仲裁
105
40% / 24%
期限切れ
81
17%
取り込み中
パブリッシュした人: 2 codes
27
開発者 27
評価
プロジェクト
1
0%
仲裁
2
0% / 100%
期限切れ
0
28
開発者 28
評価
(193)
プロジェクト
249
20%
仲裁
22
50% / 18%
期限切れ
0
取り込み中
29
開発者 29
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
30
開発者 30
評価
(10)
プロジェクト
14
43%
仲裁
0
期限切れ
3
21%
類似した注文
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
### What I'm looking for / Qué busco I am not looking for someone to code an idea I have. I am looking for someone who **already has a profitable and consistent strategy on XAUUSD** and needs a partner to scale it. No busco a alguien que programe una idea mía. Busco a alguien que **ya tenga una estrategia rentable y consistente en XAUUSD** y necesite un socio para escalarla. --- ### The deal / El trato - I will
Auto trading system with hi probability win rate. Trades and auto trading system works well on gold and forex most important risk reward ratio. It must be 1:3 or more then that
Hello, i would like to have a ninjatrader indicator. I wanna to have a footprint indicator with delta, imbalances and big trades identifiable. Also I wanna sell it on whop. And it should be fully customisable in NT8
Intraday Trade Ninja EA Indicators used: Price Border(TMA) MA-X Arrows xSuperTrend Candles EMA 49 & 89- Per Candle Color Switching Lemansignal 200 SMA Major Criteria to consider before a trade setup or condition is taken · The price must have touched/tested the upper or
Panda101 500+ USD
//+------------------------------------------------------------------+ //| Simple Moving Average Crossover EA | //+------------------------------------------------------------------+ #property strict input int ShortMA = 10; input int LongMA = 50; input double LotSize = 0.01; int shortMAHandle; int longMAHandle; //+------------------------------------------------------------------+ int OnInit() { shortMAHandle =
I need an experienced MQL5 developer to build a custom MT5 Expert Advisor for XAUUSD. Strategy Overview: Trend-following using EMA 50/200 on H4 and H1 Pullback entries on M5 using RSI + candle confirmation No martingale, no averaging down Controlled scaling only when trades are already in profit Maximum 2–3 positions per direction Risk Management: Daily loss limit (%) Equity hard stop (%) Consecutive loss pause
I need a ready-made professional trading EA similar to my current scalping bot, but improved for consistent profit and better risk control. Requirements: - Works on XAUUSD (M5 timeframe) - Fixed lot option (start with 0.01) - Opens only one trade at a time (no multiple positions) - Small, fast entries (scalping style) - Better risk-reward (SL must NOT be bigger than TP) - Breakeven function - Trailing stop to secure

プロジェクト情報

予算
100+ USD
締め切り
最低 2 最高 5 日