Trading robot · MT5

King V4 Balance

by Y1110a

MetaTrader 5 expert advisor that combines dynamic grid trading, martingale lot scaling, and liquidity zone filters for automated trading.

High risk

GitHub stars1
Forks0
Last update3 months ago23 Jul 2026
LicenceNone stated

Overview

Operating primarily on the M1 timeframe, the EA identifies anchor points to place pending orders around liquidity bands while adjusting grid spacing according to ATR volatility. It incorporates equity compounding, trend scoring to gate grid entries during strong directional moves, and spread filters. Risk management features include net exposure caps, maximum position limits, daily loss budgets, and daily profit targets. Notable limits include aggressive martingale multiplier scaling, grid layering, and lack of fixed per-order stop losses.

Details

Author

Y1110a on GitHub

Type

Trading robot

Markets

Gold, Forex

Timeframes

M1-M5

Risk Profile

  • Uses martingale lot scaling: losses can grow fast
  • Opens a grid of orders: exposure builds up in a trend
  • Holds opposite positions at once
  • Trades without a fixed stop loss

Input Parameters

Read from king-v4-balance-优化版.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
HaltAfterCloseboolfalse平仓后停止交易
StartLotdouble0.04起始手数
GridLotMultiplierdouble1.50震荡基准马丁倍率
TrendMultiplierMindouble1.10趋势内马丁倍率下限
EquityBaselinedouble10000.0基准账户余额(手数按当前权益相对此值复利缩放)
EquityScaleCapdouble200.0复利缩放上限倍数
StepAtrMultiplierdouble1.00网格间距系数(× M1周期ATR)
CommissionPerLotdouble6.0每手手续费(美元,点差账户填0)
Slippageint10平仓允许滑点(点)
Magiclong888999
MaxOrdersint50最大持仓总数
MaxSpreadint25点差限制(点)
Show all 38 inputs
NameTypeDefaultDescription
NetExposureCapdouble0.08净敞口上限(多单减空单绝对值)
MaxPerSideint10单侧最大持仓数
FastTakeProfitdouble0.80单仓快速止盈($/0.01手)
StartTimestring00:00EA开始时间
StopTimestring24:00EA结束时间
DailyProfitTargetdouble0.0每日盈利目标,>0启用
NewsPauseMinutesint0新闻前后暂停(分钟),0=关闭
UseLiquidityZonesbooltrue启用流动性区
LZ_LookbackBarsint60锚点回看K线数
LZ_SkipRecentBarsint3跳过最近K线数
LZ_TriggerBandPointsint300触发带宽度(锚点±N点)
LZ_FirstOrderGapPointsint600首单距锚点距离
LZ_OrderSpacingPointsint300档位间距(点)
LZ_OrdersPerSideint4每侧挂单档数
LZ_FirstLotFractiondouble0.5首单手数系数(×对侧持仓量)
LZ_BreakoutMultiplierPerLeveldouble4.0突破侧倍率(每档×N)
LZ_RejectionMultiplierPerLeveldouble2.0反弹侧倍率(每档×N)
LZ_BreakoutTotalCapdouble4.0突破侧总手数上限(×对侧持仓量)
LZ_RejectionTotalCapdouble2.0反弹侧总手数上限(×对侧持仓量)
LZ_LargeOrdersFirstbooltrue大手数优先排列
LZ_TrailFakeBreakoutbooltrue假突破跟踪开关
LZ_TrailStepPointsint50跟踪步长(点)
LZ_TrendScoreMindouble45.0趋势门控分值(低于此值不挂单)
LZ_DailyLossBudgetPctdouble5.0日内亏损预算(%,超过则当日停挂)
LZ_OcoFloatingLossPctdouble2.0撤单浮亏阈值(%,低于则撤单)
LZ_ZoneRecycleMinutesint30冷却时间(分钟)

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone Y1110a/EA- from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar Expert Advisors

STO Martin

by crq644
3 stars

STO Martin is a grid-based trading robot for MetaTrader 5 that uses technical indicators to manage entries and recoveries. It employs a Stochastic Oscillator for execution signals and a Moving Average to filter trades according to the prevailing trend. The EA features a martingale lot-scaling system that adds positions

MT5 Trading robot MartingaleGridTrend following High risk
Updated 3 years ago None stated GitHub repository of STO Martin

AutoTrade EA

by liucheng-12-08
3 stars

AutoTrade EA is a scalping robot for MetaTrader 4 and 5 that utilizes a multi-indicator signal scoring system based on Exponential Moving Average crossovers and RSI levels. It employs an aggressive trade management strategy featuring a dynamic grid and a stepped martingale lot scaling system where position sizes increa

MT4MT5 Trading robot ScalpingIndicator crossoverMartingale High risk
Updated 8 months ago None stated GitHub repository of AutoTrade EA

Grid Hedge Combine

by Far-1d
3 stars

Grid Hedge Combine is a MetaTrader 5 expert advisor designed to automate market entries using a mixture of grid and hedging techniques. It opens initial trades and layers subsequent orders at predefined pip intervals when the price moves against the position. The EA features lot size scaling, allowing for aggressive or

MT5 Trading robot GridMartingaleHedging High risk
Updated 2 years ago None stated GitHub repository of Grid Hedge Combine
2 stars

This Expert Advisor for MetaTrader 5 focuses on gold trading through a combination of mean-reversion signals and a grid management system. It uses multi-timeframe filters, including exponential moving averages and ADX on the H1 timeframe, to identify trend direction while executing entries on M15 based on RSI and Bolli

MT5 Trading robot Mean reversionGridMartingale High risk

Fibonacci ICT EA

by Shifrozy
2 stars

Fibonacci ICT EA for MetaTrader 5 combines institutional price action concepts with Fibonacci retracement levels. It identifies higher timeframe trends and enters on pullbacks to specific golden zones using confirmations like Break of Structure and Fair Value Gaps. The system includes robust risk management such as per

MT5 Trading robot SMC / ICT / price actionIndicator crossoverMean reversion High risk
Updated 2 months ago None stated GitHub repository of Fibonacci ICT EA

Mr X Grid Hedge

by ibrahimzameel9232-lgtm
2 stars

Mr X Grid Hedge is a MetaTrader 5 expert advisor specifically designed for XAUUSD trading. It utilizes a grid strategy with entry signals confirmed by a combination of EMA crossovers, RSI bounds, and ATR volatility filters. The system manages risk through automated hedging triggered by drawdown or specific grid depth.

MT5 Trading robot GridMartingaleHedging High risk
Updated 11 months ago None stated GitHub repository of Mr X Grid Hedge

More gold EAs

Related on ForexR

Need a Broker for MT5?

Compare regulated brokers that support MT5, with spreads, minimum deposits and leverage side by side.

Compare MT5 brokers