EA-62248 · Grid

BuildYourGrid EA v1.8

This EA implements a grid trading strategy for MetaTrader 5, placing buy and sell pending orders at fixed price intervals around the current market price. It manages the grid by adjusting order levels, taking profit when the overall grid position reaches a target, and optionally using martingale-like lot scaling on subsequent grid levels.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryGrid
RiskDangerous
Blow-up riskHigh
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4, D1
IndicatorsNone
AuthorCopyright 2020-2023, Nikolaos Pantzos

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.00%0.00%0.00%0—————Not convertible yet

Why this EA never traded: no entry rule survived the conversion.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Blow-up risk: High

  • Opens a grid of orders at fixed price steps
  • Has no stop loss or trailing stop

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

This EA implements a pure grid trading strategy, placing buy and sell pending orders at predefined intervals above and below the current price. Entry conditions are purely mechanical — orders are triggered when price reaches a grid level, with no trend or indicator-based signal generation. Exit conditions are met when the cumulative floating profit of the entire grid reaches a configurable take-profit target, or when a maximum loss threshold is hit. Position sizing uses incremental lot scaling where each subsequent grid level can increase the lot size by a multiplier or fixed increment, giving the strategy an inherent martingale-like character. Money management relies on configurable parameters such as maximum grid levels, starting lot size, and lot multiplication factor, but lacks dynamic adjustment based on account equity. The strategy performs well in ranging markets but faces significant risk of catastrophic drawdown in strong trending conditions due to continuously adding positions against the trend.

Strengths

  • Generates consistent profits in ranging markets by capitalizing on price oscillations within the grid
  • Highly configurable parameters allow flexible adjustment of grid spacing, lot sizes, and levels
  • Bi-directional buy and sell grids can capture opportunities from price movements in either direction

Weaknesses

  • Continuously adding positions against the trend in strong directional markets can lead to catastrophic losses or account blowout
  • The lot increment mechanism is essentially a martingale variant, causing risk to grow exponentially with grid depth
  • No trend filtering mechanism — the grid is placed mechanically regardless of market regime

Possible improvements

  • Add trend filtering indicators (e.g., moving averages or ADX) to reduce or pause counter-trend grid placement during strong trends
  • Implement dynamic position sizing based on account equity or risk limits to cap maximum exposure
  • Add a hard stop-loss mechanism at maximum grid levels that forces full closure instead of relying solely on floating P/L thresholds

Risk assessment

Overall risk: Dangerous

  • Grid combined with martingale-style position scaling amplifies risk infinitely in one-sided markets
  • No per-order stop-loss — exits rely solely on aggregate floating P/L thresholds
  • Maximum grid level limits are insufficient to prevent account blowout in extreme market conditions

Evaluation scores

Code quality3.0
Strategy logic2.0
Risk management1.0
Robustness2.0
Innovation2.0
Documentation2.0
Overall2.0

Parameters

ParameterDefaultDescription
GridStep200Grid spacing in points
MaxGridLevels10Maximum number of grid levels
StartLot0.01Starting lot size
LotMultiplier1.5Lot size increment multiplier
TakeProfit100Overall grid profit target in currency
MaxLoss500Maximum loss limit in currency
MaxSpread30Maximum allowed spread
MagicNumber123456Order magic number to identify this EA's orders
BuyEnabledtrueWhether to enable buy grid orders
SellEnabledtrueWhether to enable sell grid orders

Similar Grid EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.