EA inputs — the three parameter groups that control everything
Every Expert Advisor exposes its brain through one panel: the MT5 Inputs tab. Signal parameters decide when to trade. Risk parameters decide how much to risk. Execution parameters decide how to place the order. This lesson maps every parameter type so you can configure any EA — yours or someone else's — with precision.
最近复查:
The 60-second version
The Inputs tab is the EA's brain interface — Signal parameters decide when, Risk parameters decide how much, Execution parameters decide how.
- Every EA has one Inputs tab — this is where you control all three dimensions of its behaviour without touching the code
- Signal parameters are the most tempting to over-optimise — changing an MA from 20 to 21 rarely improves performance and often overfits to historical data
- Risk parameters have the most direct impact on your account — a Lot Size of 1.0 on a $500 account is an account-killer regardless of signal quality
- The Magic Number is a hidden execution parameter that most beginners ignore — collisions between two EAs sharing the same magic number cause silent trade management failures
- Prop firms review EA inputs as part of their onboarding review — poorly configured risk parameters are the number-one reason funded EAs get accounts pulled
When prop firms reviewed EA input configurations in 2024, risk parameter misconfiguration — not signal logic — was the leading cause of funded account breaches within the first six weeks.
随着2024年prop firm挑战赛的爆发,'通关EA'的市场也随之膨胀——它们被优化得在历史数据上很好看,而不是为了真正交易。规律始终如一:回测惊艳,实盘账户爆仓。
来源EA Input Panel Simulator
Explore the three groups of EA input parameters. Click any group to see its parameters, what each one controls, and the effect of increasing or decreasing its value.
The three parameter groups
The Inputs tab — your EA's control panel
In aviation, a commercial aircraft has a flight management computer — the system that runs the autopilot logic. Pilots do not rewrite the FMC code mid-flight to change behaviour. They use the control display unit: a panel with structured inputs that let them configure waypoints, speeds, altitudes, and fuel reserves without touching the underlying system. The inputs are intentionally separated from the code because changing code mid-flight would be catastrophic, but reconfiguring parameters is a routine and expected operation.
MetaTrader 5 Expert Advisors follow the same design principle. The MQL5 developer writes the trading logic once and compiles it to a protected .ex5 file. You, the operator, interact with that logic exclusively through the Inputs tab — a structured panel where every configurable aspect of the EA's behaviour is exposed as a named parameter with a type, a default value, and an acceptable range. You access this panel by double-clicking the EA in the Navigator panel, or by right-clicking the EA icon in the top-right corner of a chart and selecting 'Inputs.'
The Inputs tab in MT5 organises parameters into a flat list, but an experienced operator mentally groups them into three categories immediately: parameters that control when the EA trades (Signal), parameters that control how much the EA risks (Risk), and parameters that control how orders are placed and tracked (Execution). A well-documented EA uses descriptive names and group separators to make these categories explicit. A poorly documented EA lists parameters in arbitrary order — but the three-group mental model still applies, regardless of how they are displayed.
Signal parameters — when to trade
Signal parameters are the parameters that control the EA's entry and exit logic — they define the conditions that must be true before the EA opens or closes a position. Every indicator the EA uses exposes its configuration through this group: the period of a moving average, the overbought/oversold levels of an RSI, the minimum ADX value that confirms a trend, the number of candles a pattern must span, the timeframe for a higher-timeframe filter.
These parameters have the most direct influence on trade frequency. A longer MA period produces fewer but potentially higher-quality signals; a shorter period produces more signals with more noise. A higher ADX minimum means the EA only trades in strongly trending conditions; a lower minimum lets it trade in ranging markets too. The relationship between signal parameter values and live performance is non-linear and highly dependent on market regime — this is why signal parameters are the most dangerous to over-optimise.
A common mistake among new EA operators is treating signal parameter optimisation as a route to better performance. In reality, running the MT5 Strategy Tester's optimiser on signal parameters and then selecting the values that produced the best historical result is the process of curve-fitting — making the EA perform well on data it has already seen. The prop-firm EA wave of 2024 demonstrated this at scale: EAs optimised to pass challenge backtests with 91% historical win rates averaged -60% drawdown within six weeks on live accounts.
Risk and execution parameters — how much and how
Risk parameters are the parameters that control what happens between a signal being generated and a position being sized. They do not affect whether the EA enters a trade — they affect how large that trade is and whether it is blocked by account-protection rules. The most important risk parameter in any EA is the lot sizing method. A fixed lot input (e.g., Lot_Size = 0.1) means every trade uses the same position size regardless of account balance. A percentage-based input (e.g., Risk_Percent = 1.0) means the EA calculates lot size dynamically from current equity and stop-loss distance — scaling up as the account grows and down after drawdowns.
Other critical risk parameters include Maximum Spread — a filter that prevents the EA from entering during wide-spread conditions, such as news events or illiquid overnight sessions. Max Daily Loss sets a circuit breaker: when the day's loss reaches this percentage of equity, the EA stops trading for the session. These parameters do not make a losing strategy into a winning one, but they prevent a losing session from becoming a margin call.
Execution parameters sit below risk parameters in the decision chain. By the time execution parameters are evaluated, the EA has already decided to trade and has sized the position. Magic Number is an integer assigned to all orders from this EA instance — every trade opened, modified, and closed is tagged with this number. If you run two instances of the same EA on two different charts without changing the magic number, one instance may close the other's positions by accident, because from the trade management code's perspective they are the same EA. Slippage (or Maximum Deviation) sets the maximum acceptable difference between the requested price and the fill price — orders that would fill with greater slippage are rejected. Trade Comment is a text string attached to every order, visible in trade history, useful for post-session analysis.
Key terms
A story from 2024
The 2024 prop-firm EA boom exposed a systematic failure in how traders configure EA risk parameters — not a failure in signal logic.
随着2024年prop firm挑战赛的爆发,'通关EA'的市场也随之膨胀——它们被优化得在历史数据上很好看,而不是为了真正交易。规律始终如一:回测惊艳,实盘账户爆仓。
When prop firms began publishing their breach analysis in 2024, the data consistently pointed to risk parameters as the primary failure mode. Traders were submitting EAs with signal parameters optimised to pass the backtest period — low drawdown, high win rate, smooth equity curve — but with risk parameters left at developer defaults or, worse, increased to trade larger lot sizes faster. The EA that passed a 30-day challenge with a 3% max drawdown using Risk_Percent = 0.5 was then launched on the funded account with Risk_Percent = 2.0 to 'earn faster.' The funded account breached within days. Prop firms responded by adding EA input review to their onboarding process — requiring traders to document their parameter configuration and explain the risk rationale before going live. The lesson: signal quality and risk configuration are separate disciplines, and a brilliant signal with reckless risk parameters produces a blown account, not a profitable one.
来源Practice
Open a real EA's Inputs tab and classify every parameter
Open MT5 on a demo account. You are going to open the built-in MACD Sample EA's Inputs tab and classify every parameter into one of the three groups. Do not change any values — the goal is classification, not configuration.
- 1
Open the Navigator panel (Ctrl+N). Expand the 'Expert Advisors' section. You should see 'MACD Sample' in the list. If you don't, click the refresh icon at the top of the Navigator panel.
- 2
Double-click 'MACD Sample.' A configuration dialog opens with three tabs: Common, Inputs, and Dependencies. Click the 'Inputs' tab. You will see a list of named parameters with their current values.
- 3
For each parameter in the list, write down which group it belongs to: Signal (controls when to trade), Risk (controls how much), or Execution (controls how the order is placed). Hint: look for parameters named with 'Period', 'Level', or 'Fast/Slow' — these are typically Signal parameters.
- 4
Find the 'Lots' parameter. Is it a fixed lot size or a percentage-based risk parameter? What does changing it from 0.1 to 1.0 imply for a $500 demo account with a 20-pip stop-loss?
- 5
Close the dialog without saving any changes (click Cancel). Return to the Navigator and note that MACD Sample is unchanged. This is safe exploration — no demo account funds were at risk because you did not attach the EA to a chart or click OK.
Mastery check
Four questions. Pass at 75% (3/4). Each question targets one of the three parameter groups.
Mastery check — Lesson 4
用 4 道题检验你的理解。答对 75/4 即可通过。
Reflect
反思
写下你的真实答案 — 仅保存在本设备上。下周用它们来发现你交易思维中的规律。
Pro deep dive
The three-group model is a useful mental framework for operators. EA developers and advanced operators deal with additional complexity in each group — here is what that looks like at a professional level.
EA input validation in MQL5
Well-engineered EAs do not trust the operator to enter valid inputs — they validate parameter values in the OnInit() function and return INIT_FAILED if a required condition is not met. This is MQL5 best practice: checking that Risk_Percent is between 0.1 and 10.0, that Magic_Number is positive, that MA_Fast_Period < MA_Slow_Period (a fast period longer than the slow period produces inverted logic), that Max_Spread > 0. The MT5 Strategy Tester logs the INIT_FAILED reason in the Journal tab. In production, a failed OnInit() stops the EA from running and logs the error — but only if the developer wrote the validation code. An EA that accepts any numeric input without validation, including 0, negative numbers, and absurdly large values, is a warning sign of low-quality development. When evaluating any EA, the first code review step is reading the OnInit() validation block.
Magic number collision in multi-EA setups
The magic number collision problem is more insidious than it appears because the failure is silent — no error appears in the journal, no warning is generated. The standard MT5 trade management pattern iterates open positions and checks that each position's magic number matches the EA's configured magic number before modifying it. When two EAs share a magic number, each EA's iteration finds the other's positions and treats them as its own. A Trailing Stop function from EA A begins trailing EA B's position. A CloseAll function in EA A closes EA B's positions before the target is reached. Preventing this requires establishing a magic number allocation convention: for example, assigning each strategy a base number (e.g., 1000, 2000, 3000) and adding the MT5 symbol index or chart period to generate a unique value per instance. Some EA developers encode the magic number algorithmically from strategy name and symbol to guarantee uniqueness across all instances automatically.
Parameter sensitivity and overfitting risk
A parameter is 'sensitive' when small changes to its value produce large changes in performance metrics. A robust EA has low sensitivity across most parameters — the performance is stable whether MA_Period is 19, 20, or 21. A curve-fitted EA shows high sensitivity — the best result is at exactly MA_Period = 20, with significant degradation at 19 or 21. MT5's Strategy Tester Optimiser produces a 2D optimisation grid that lets you visualise sensitivity directly: the colour map shows profit factor across the parameter space. A well-formed optimisation surface has a broad plateau of good performance rather than a sharp spike at a single optimal value. If the optimal value is at the edge of the tested range, the true optimum may be outside the range entirely — test a wider range. Parameter sensitivity analysis is part of every professional EA validation process and takes less than 30 minutes using the MT5 optimiser's built-in visualisation.
EA input documentation standards
Professional EA developers follow a documentation standard for inputs: every input has a comment string (the human-readable label shown in the MT5 Inputs tab), a defined minimum and maximum value, a group separator comment, and documentation in the EA's source code explaining units and edge cases. The MQL5 input declaration syntax supports all of this natively: input string Comment1 = '--- Signal Parameters ---' creates a group header; input double MA_Period = 20 // Fast MA period (bars, min=5 max=200) makes the units explicit. When evaluating a third-party EA, the quality of input documentation is a reliable proxy for overall code quality — an EA whose inputs are labelled 'param1', 'param2', 'value3' with no explanations was not built by someone who expected other people to use it, and that has implications for how robust the underlying logic is likely to be.
Sources
显示答案
Signal parameters — when to trade (indicator periods, thresholds, entry conditions); Risk parameters — how much to risk (lot size, risk percent, max spread, max daily loss); Execution parameters — how to place the order (magic number, slippage tolerance, trade comment).
仅供教育用途 — 非投资建议。交易存在资金亏损风险。请始终在模拟账户上练习并使用止损。 ← 返回 Automated Trading