BrokersConfirms helps you choose the right foreign exchange exchange.
The FX Margin Trading series has covered the entire practical workflow of traders from the first to the 14th series: market structure, chart analysis, risk management, order execution, trading log, platform, market duality, and trading psychology. Expanding on the automated tools (OCO and trailing stops) covered in the 14th series, the next area to reach is EA (Expert Advisor) Automated Trading and Algorithmic TradingIt is.
EA is not simply a "tool that clicks through trades on behalf of people." It is a trading system that is designed to Encoded with code to run 24 hours without human interventionWhile allowing it to be done, it also enables the mathematical verification of the system through a backtest, and provides scalability that allows it to be applied simultaneously to multiple currency pairs and timeframes. At least three of the four pitfalls in trading psychology outlined in Part 14 (emotional control, confirmation bias, and revenge trading) are structurally blocked by using an EA.
But if you make the EA wrong, it will actually "A machine that automatically deletes accounts"It is an open secret in the industry that more than 90% of EA that are deployed into live trading based on test results alone convert to an average R-value of zero within the first three months. The reason for this is not a problem with the code’s performance, but rather Overfitting·Curve Fitting·Survival Bias·Differences in Transactional EnvironmentBecause they trusted only the batch test figures without knowing what they were.
In this 15th episode, for those new to EA development (1) The concept, working principle, and integration with MT4/MT5, (2) 5 Major Strategy Types — Trend, Inverse Trend, Scalping, HFT, News Trading, (3) Basic structure of MQL4 and MQL5, and example of minimum EA code, (4) The core of the backtest and the 5 major pitfalls that beginner EA developers inevitably encounter + Walk-Forward and Out-of-Sample validation methodsI will summarize them in turn. Not an introductory overview. The perspective of someone who has actually written a line of codeI will explain it in detail in the article.
📌 First, a key principle to keep in mindThe core of EA is not the code. "Verifiable trading system"In 11 episodes of the R-multiple trading journal, only systems that have validated their expected returns are worth coding. Creating an EA based on untested intuition only speeds up automation of intuition, leading to faster and greater losses. The starting point for EA development is not the code, but the validation of one’s own trading journal.
① The concept of EA, its working principle, and the fundamental differences between MQL4 and MQL5
EA (Expert Advisor)It is an automated trading program that works on the MetaTrader platform. Written in the MQL4 (for MT4) or MQL5 (for MT5) languages, it is compiled into .ex4/ .ex5 files and attached to the chart. When a price event occurs at the time frame of the chart, it executes the pre-defined logic, which is based on the time frame of the chart.
EA working flow — price event → logic → order
EA operates with the following four core event functions:.
| Event function | At the time of the call | Main use |
|---|---|---|
| OnInit() | Once when EA is attached to the chart | Variables initialized, handle created, parameter verified |
| OnTick() | Whenever a new quote (tick) comes in | Determining entry and exit logic |
| OnTimer() | Every specified time interval (optional) | Periodic work unrelated to tick |
| OnDeinit() | Once when EA is removed from the chart | Unlocking and cleaning the handle |
The most important thing is OnTick()The market is active, it is called dozens of times per second; it is quiet, it is called only once per second. In other words, all entry and exit decisions of the EA are determined by the logic inside OnTick(). One of the most common pitfalls faced by beginner EA developers is "The same signal repeats every tick, entering the same place dozens of times"This is a preventable accident — the status management should be set to allow entry only once when a signal is generated.
MQL4 vs MQL5 — A difference not in the simplicity of the version, but in the paradigm
Although the grammar of the two languages is similar, there are fundamental differences. While they are based on C, MQL5 is a new paradigm that introduces object-oriented programming and multi-threading in a more comprehensive way.
| Items | MQL4 | MQL5 |
|---|---|---|
| The language paradigm | Procedural-oriented (functional) | Introduction of Object-Oriented Programming (Classes, Inheritance, Polymorphism) |
| Order function | OrderSend() Single function |
MqlTradeRequest Structures + OrderSend() |
| Position management | Default hedging mode (can simultaneously buy and sell the same asset) | Selecting the Netting/Hedging mode |
| Transaction history | OrderSelect()Touring directly with Ro |
HistorySelect()After specifying the row period, scroll through |
| Event model | Single thread | Multi-threaded + independent context by chart |
| Execution speed | Average | About 2 to 3 times faster (native compilation) |
| Black-box engine | Basic for a single currency pair | Support for multi-currency pairs and real tick data testing |
| Market share | Over 70% of the Korean EA community | About 30% (growing) |
Recommendations from practitioners' perspectiveIf you are just starting to learn EA, it is advisable to start with MQL4. There is an overwhelming amount of learning materials in Korean, the EA assets are abundant, and it is a procedural style with a smooth learning curve. After mastering the flow and pitfalls of EA with MQL4, moving on to MQL5 makes the object-oriented structure much more naturally absorbable. On the other hand, if you are already familiar with object-oriented programming or you urgently need to test multiple currency pairs, you can start right away with MQL5.
The position of EA in the trading circuit
If we map the EA to the circuit that has been compiled for 14 circuits, the following results are obtained.
- Analysis of the 8th episode chart → Code it as an entry signal function (e.g., 200EMA breakout + RSI recovery of 30)
- Risk management in Episode 9 → Implementing the 1% rule as an automatic position sizing function
- 10-piece order type → Orders are automatically placed using OrderSend for both market price, fixed price, OCO, and trailing orders.
- 11th Transaction Log → Automatic extraction of EA execution logs + Account History → Automatic creation of trading logs
- 12 ways to use MT4 → Add EA to chart, activate AutoTrading button
- 14-Part Transaction Psychology → Blocking the emotional involvement itself at the code stage
That is to say, EA A vessel that houses all the circuits from Episode 14 in one placeThis is a one-line code that corresponds to one of the system's rules. The clearer this mapping is, the more stable the EA will operate.
2. 5 Types of EA Strategies — Trend, Inverse Trend, Scalping, HFT, and News Trading
There are countless strategies that can be implemented using EA, but the five types most commonly used in practice are outlined as follows: the working principle of each type, the appropriate market conditions, and Mistakes that practical people often makeWe will cover it up to the last detail.
| Type | Suitable market | Representative indicators and logic | The main trap |
|---|---|---|---|
| 1. Trend-Following | Directional strong trend | Moving Average Golden Cross; MACD; Doji Channel | Signal noise increases in the sideways range |
| 2. Reversal Trend (Mean Reversion) | Box-bound and ranging range | RSI, Bollinger Bands, Stochastic | Large losses at once when entering a strong trend |
| 3. Scalping | Unique-time currency pairs and the London session | 1-5 minute range short-term breakthrough and rebound | Sensitive to spread and slippage |
| 4. HFT (High-Frequency Trading) | Micronomic price inefficiency | Depth of Hoga Chang and Speculative Trading | Losses converted by a 1ms difference in VPS latency |
| 5. News trading | Immediately after the NFP, CPI, and FOMC announcements | Take advantage of price gaps and increased volatility | Sleepy 5 to 50 pips, Ripple frequent |
Type 1 — Trend-Following
This is the most classic and most commonly used type of EA. "Buy when moving average crosses the golden cross, sell when it crosses the dead cross" It ranges from simple logic to complex logic that checks the trend alignment of multiple timeframes.
- StrengthsWhen entering a large trend, the cost-benefit ratio can be as high as 1:5 to 10, and the code implementation is simple.
- Weaknesses: There are frequent signal events in the ranging range, resulting in accumulation of false entries; the win rate is around 30-40%, so there is psychological pressure.
- Common TrapsIn most cases, the result of a positive R test in a baccalaureate test is Strong trend dataCurve-adjusted results. When inputting the real-time data without separately verifying it, the cumulative −5R occurs in the first downward phase.
- Practical recommendationsBy adding an additional condition that only enters the ADX > 25 range with the ADX (Trend Strength) filter, it can cut noise from the momentum trading signal by about 60%.
Type 2 — Reversal of the Trend (Mean Reversion)
It is based on the hypothesis that if prices deviate from the average, they will eventually return to the average. From simple logic such as buying at RSI below 30 and selling above 70 to the rebound pattern after the Bollinger Bands touch ±2σ.
- StrengthsPossibility of a winning rate of 60-70% in the ranging market; frequent entry allows for rapid accumulation of data
- WeaknessesOnce a strong trend enters, the RSI may remain above 70 for several days, and during that time, the short positions may break down to −20R.
- Common Traps: "The trend is safe"This is a mistaken perception. In reality, there are overwhelmingly many patterns where after accumulating small profits, a single large loss wipes out the entire accumulated profit at once (the tail is a thick distribution).
- Practical recommendationsBe sure to include three safety measures: a stop loss setting + daily loss limit + a trend filter (e.g., only enter when ADX is within the <20 range).
Type 3 — Scalping
This is a strategy that quickly accumulates small profits of 5 to 15 pips on a 1-5 minute timeframe. The frequency of entry is very high, and trading up to 30 to 100 times a day is common.
- StrengthsQuick accumulation of small profits without significant market exposure, minimizing nighttime risks
- WeaknessesTransaction costs (spread + fees) wipe out up to 30–50% of cumulative profits
- Common TrapsWhile the backtest returns to the average spread assumption, the real-world trading results are often distorted by the volatility range spread widening, with the EA backtest +30R turning into a real-world −10R scenario.
- Practical recommendations: Must be done during the pre-test period "Actual variation spread" Model usage (MT5 only supported; MT4 requires external tools), and ECN account + low commissions + fast VPS required
Type 4 — HFT (High-Frequency Trading)
It is the most advanced strategy that aims to exploit the price inefficiencies of the tick-by-tick chart. The accessible area for ordinary individual traders is actually very limited.
- StrengthsThe more efficiently the market functions, the more small price differences are constantly being eliminated.
- WeaknessesDue to the VPS location (the physical distance from the exchange server), network latency, and the single-thread limitation of MT4, this is almost impossible in a normal environment.
- Common Traps: "Most commercial products with the name "HFT EA" are actually 1-5 minute bar scalping EAMoreover, true HFT requires its own API + co-location + low-level optimization at the C++ level.
- Practical recommendationsIt is strongly recommended that ordinary individual traders do not try this. To take the challenge, a combination of MQL5 multi-threaded + exchange headquarters data center VPS + advanced license trading is required.
Type 5 — News trading
This is a strategy for containing price spikes immediately after the release of macroeconomic indicators such as the NFP, CPI, and FOMC. It is common to place a two-way OCO before the release.
- StrengthsA great opportunity to catch 50-100 pips with just one entry
- WeaknessesSluggish 5-50 pips, frequent rejections of orders, widening spread by 5-10 times in volatile segments
- Common TrapsIn a test environment, it works perfectly; in a real trading environment, the exchange server gets overloaded at the moment of announcement, resulting in orders being rejected or settled at a slippage of 30 to 50 pips.
- Practical recommendations: Stability of volatility trading rangeMust use this verified exchange, and insert the 30-1 minute order non-delivery logic (News Filter) code just before and after the announcement to avoid the Sluggish Rush period itself.
Guide to choosing the EA strategy type that suits you
The appropriate type depends on your time, capital, and technological level. The general recommended flow is as follows:.
- Beginner in EA → Follow the trend with a simple EA; learn the code and test flow
- Intermediate → Market phase segmentation learning with a trend and momentum filter combined EA
- Premium → Multiple currency pairs and multiple timeframes EA, integrated with news filter
- Experts → MQL5 Object-Oriented + Multithreaded + Self-Test Infrastructure
- HFT → Not a general private area; requires separate infrastructure and capital

3. MQL4 and MQL5 Basic Structure — The foundation of EA as understood by real code
This paragraph is good to go through once for those who are creating an EA for the first time, as well as those who have already created one. Structure of a minimum unit EAIt covers the real compileable MQL4 code examples.
Minimum skeleton of MQL4 EA
All MQL4 EAs have the following four event function frameworks:.
//+------------------------------------------------------------------+
//| MinimalEA.mq4 |
//+------------------------------------------------------------------+
#property strict
// External input parameters (can be changed in the backtest and optimization)
extern int MagicNumber = 12345; // The unique number of this EA
external double LotSize = 0.10; // entry lot
extern int StopLoss = 300; // Stop loss distance (points)
extern int TakeProfit = 600; // Take profit distance (points, RR 1:2)
extern int MA_Period = 200; // Moving average period
//+------------------------------------------------------------------+
//| 1 run when attaching the EA chart |
//+------------------------------------------------------------------+
int OnInit()
{
Print("MinimalEA initialized on ", _Symbol);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Executed every time a new quote arrives — the core of the EA |
//+------------------------------------------------------------------+
void OnTick()
{
// Step 1: If there are existing positions in the same EA, prevent duplicate entries
if(CountMyPositions() > 0) return;
Step 2: Entry signal — Buy when closing price breaks above the 200EMA
double ma = iMA(_Symbol, 0, MA_Period, 0, MODE_EMA, PRICE_CLOSE, 0);
double prevMA = iMA(_Symbol, 0, MA_Period, 0, MODE_EMA, PRICE_CLOSE, 1);
double prevClose = iClose(_Symbol, 0, 1);
if(prevClose > prevMA && Bid > ma) {
Step 3: Entry into the market (set the market price + stop loss + take profit simultaneously = OCO effect)
double sl = NormalizeDouble(Ask - StopLoss * _Point, _Digits);
double tp = NormalizeDouble(Ask + TakeProfit * _Point, _Digits);
int ticket = OrderSend(_Symbol, OP_BUY, LotSize, Ask, 3, sl, tp,
"MinimalEA", MagicNumber, 0, clrBlue);
if(ticket = 0; i--) {
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if(OrderSymbol() == _Symbol && OrderMagicNumber() == MagicNumber)
count++;
}
}
return count;
}
Five key points to be addressed in this framework
- The importance of Magic Number — If you are operating multiple EAs on the same account simultaneously, each EA must be identified with a Magic Number to ensure that it only manages your own positions. Without this, there is a risk that EA-A will mistakenly close the positions of EA-B.
- Blocking duplicate entries (CountMyPositions) — The pitfalls of OnTick mentioned above. Since entry occurs every tick when the signal condition is met, you must always check the existing position before entering.
- NormalizeDouble + _Point + _Digits — The stop-loss and take-profit prices must be rounded to NormalizeDouble. Otherwise, OrderSend often fails to execute the price request. In a 5-digit price quote broker (e.g., EURUSD at 1.08501), the _Point is 0.00001, so if StopLoss is 300, it becomes 30 pips.
- The second argument of iMA (symbol, 0, period, ...) is 0 — Refers to the current chart timeframe. If specified explicitly as PERIOD_H1 or PERIOD_H4, multi-timeframe analysis is possible.
- OrderSend Sluggish Factor (3) — Slit size allowed when entering the market price. Too small will lead to order rejection in the volatility range, too large will distort the profit/loss ratio. Generally recommended to be 3–5.
Changes when applying the same logic in MQL5
MQL5 changes the OrderSend call method to be based on a structure.
// MQL5 - Example of a buy order
MqlTradeRequest request = {};
MqlTradeResult result = {};
request.action = TRADE_ACTION_DEAL;
request.symbol = _Symbol;
request.volume = 0.10;
request.type = ORDER_TYPE_BUY;
request.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
request.sl = request.price - 300 * _Point;
request.tp = request.price + 600 * _Point;
request.deviation = 3;
request.magic = 12345;
request.comment = "MinimalEA";
request.type_filling = ORDER_FILLING_FOK;
if(!OrderSend(request, result)) {
Print("OrderSend failed: ", result.retcode);
}
The code becomes longer, but the struct-based approach is safer in a multi-threaded environment, and the implementation of partial binding and retry logic is clearer. Moreover, MQL5 makes it possible to create structures using classes as follows:.
// MQL5 - Object-oriented style
class CTrendStrategy : public CStrategyBase {
public:
virtual bool ShouldEnter() should override {
double ma = iMA(_Symbol, PERIOD_H1, 200, 0, MODE_EMA, PRICE_CLOSE);
return iClose(_Symbol, PERIOD_H1, 1) > ma;
}
virtual double CalculateLotSize() override {
// 1% rule applied automatically
return AccountInfoDouble(ACCOUNT_EQUITY) * 0.01 / RiskPerLot();
}
};
This object-oriented pattern is a strength of MQL5. Managing multiple strategies through class inheritance allows for maintaining code even if the number of EA increases to 5 or 10.
5 code details frequently missed by practitioners
- Blocking entry just before weekend/Friday closing —
if(DayOfWeek() == 5 && Hour() >= 22) return;Avoid weekend gap risk with the same time filter - Spread filter —
if((Ask - Bid)/_Point > MaxSpread) return;Blocking entry into the volatility zone (automatic stop entry if spread is more than 5 times) - Check the minimum margin —
if(AccountFreeMargin() < MinMargin) return;Blocking entry before margin call - Retry if OrderSend fails — GetLastError branch-by-branch retry logic is required to prevent a single failure from leading to an overall EA halt
- Log output —
Print()If you place it at all points of entry, clearing, and errors, it can be used for real-time debugging and automatic extraction of trading logs.
These five are safety measures that should be included in all EAs. If they are missing, even if the backtest runs smoothly, in real-world trading, an exception situation will cause the EA to stop or send the wrong order.
4. Key to White-Testing + 5 Common Traps for Beginner EA Developers + Walk-Forward Verification
This paragraph is the essence of 15 episodes. It would be possible to create the EA code in a week, but, "Checking whether this EA is a buy-side R in real tradingThe average time for this process is 3 months to 1 year. And 95% of EA developers fall into the same trap during this verification phase.
The basics of white-box testing — Using the Strategy Tester
MT4·MT5 Strategy TesterIt provides an in-built batch testing engine. Key usage flow:
- In MetaEditor, compile the EA → create the .ex4 file
- MT4 menu [View → Strategy Tester] or shortcut Ctrl+R
- Select EA → Specify currency pair, time frame, and period → Select model (Every Tick / Control Points / Open Prices)
- Start button → Perform a white-test
- Result verification: Total profit/loss factor; maximum drawdown; win rate; average R
Key indicators for interpretation of Strategy Tester results: 4 key metrics
| Indicators | Meaning | Criteria for a sound EA |
|---|---|---|
| Net Profit | Total net profit | Conception (of course) |
| Profit Factor | Total revenue ÷ total loss | 1.5 or higher (less than 1.0 is a loss for the EA) |
| Maximum Drawdown | Maximum cumulative loss | Less than 20% (more than 40% is dangerous) |
| Sharpe Ratio | Risk-adjusted return | 1.0 or higher (2.0 or higher is excellent) |
However, there are overwhelmingly many cases where an EA that performs well on all these indicators fails in real trading. The following are the five main pitfalls:.
5 pitfalls for beginner EA developers
Trap 1 — Overfitting·Curve Fitting
It is the most common and deadliest trap. As you endlessly adjust parameters to make the test results look good, the EA "Tools that only work well during specific periods in the past"It becomes rotted.
- Optimizing 10 parameters into 10 levels each yields 10^10 = 10 billion combinations. Of those, 10,000 are by chance good results.
- Choosing the best of those 10,000 results means that it’s not a "proven EA," but a "curve adjusted by luck."
- Symptoms: Test Profit Factor is above 3.0, but accumulated -5R from the first month of trading.
- Defense strategyMinimize the number of parameters (less than 3-5), and validate the optimization using Out-of-Sample testing
Trap 2 — Look-Ahead Bias (Using Future Data)
This occurs when the EA is tested in a code error, knowing the "future price". Common cases:
iClose(_Symbol, 0, 0)Used to determine the signal → The 0th index represents the closing price of the current bar, that is, a value that has not yet been determined.- The closing price viewed by traders worldwide is determined after the bar closes; the code then acts as if the bar had closed before.
- Solution: Signal judgment must be made with certainty
iClose(_Symbol, 0, 1)(Previous bond = confirmed bond) Use
With this one line difference, it is common for the test results to flip from +10R to −2R.
Trap 3 — Missing transaction costs or unrealistic assumptions
The default settings in Strategy Tester are based on the average spread assumption. The actual trading results may vary.
- Asian early morning EUR/USD spread: Average 1.5 pips (default test value)
- Immediately after the FOMC announcement: 5-10 pips (completely nullifying the profitability of scalping EAs)
- Weekend gaps: Backtesting does not include gap modeling; real-time transactions occur every week
- Commission and swaps: Backtesting is often missing
Defense method: MT5 "Real Tick Data" Use the backtest mode (reflecting the actual variation spread), or import the actual spread data using an external tool.
Trap 4 — Survivor Bias — Trap in currency pair and time period selection
When applied to EUR/USD, it doesn't work well; it doesn't work well with other currency pairs either. Moreover, when testing with data from 2020 to 2022, when there was a strong trend, the trend-following EA performed very well; but in 2023 to 2024, when the market was in a long sideways trend, it fails miserably.
- Solution: Multiple currency pairs + multiple time zones Test in advance is mandatory
- Minimum verification: EUR/USD·GBP/USD·USD/JPY·AUD/USD 4 pairs + last 3 years·previous 3 years both periods
- If the EA has a positive R in all combinations, it is robust; if it only has positive R in some combinations, the EA is curve-fitted to that subset.
Trap 5 — Differences in real-market conditions (Real Market vs Tester)
The most ignored but biggest trap: The fundamental difference between Strategy Tester and real-world trading:
- Sleepy — Tester is 0 or fixed value; real-time trading is based on market fluctuations, 0 to 50 pips
- Liquor — Tester is 100% confirmed; real-world transactions reject volatile trading periods
- Platform lag — Tester immediately processed, real-time transactions were delayed due to exchange server response
- Asymmetric data — Tester is Bid-based, Real-time trading is Bid/Ask separated
- Margin Call and Stopout — Tester models, but differs from the actual forced liquidation mechanism in real-world transactions
Walk-Forward Analysis — A standard method for detecting overfitting
This is an industry standard method of robustness verification. Data is divided into time sequences and verified in the next flow.
- Split the entire period — Example: Data for 2018~2024 divided into 12 segments of 6 months
- Optimization region (In-Sample) — Parameter optimization in the first four stages (2018–2020)
- Out-of-sample verification — Apply the optimized parameters to the next phase (late 2020), and check the results.
- Window sliding — Delaying the verification phase by one step at a time, repeating the above process
- Overall results — If the average R of the Out-of-Sample intervals is positive, the EA is properly fitted to the In-Sample data; if negative, the EA is not properly fitted to the In-Sample data.
MT5 has a built-in Walk-Forward option in the Strategy Tester, which is immediately available for use. MT4 requires external tools (e.g., Tickstory + separate scripts). Only EA that passed the Walk-Forward verification is used in real tradingDoing so prevents 90% of all loss accidents.
5-step minimum verification procedure before entering the real estate transaction
| Steps | Action | Criteria |
|---|---|---|
| 1. Basic background testing | Single currency pair backtest with recent 3-year data | Profit Factor 1.5↑, MDD 20%↓ |
| 2. Verification of multiple currency pairs | Same parameter test for 4 currency pairs | All are positive R |
| 3. Walk-Forward Analysis | Six-month split verification | Out-of-Sample Range Average R Positive |
| 4. Real-time operation of demo accounts | Minimum 1-month demo account available | Average R difference within 30% of the benchmark against the white test |
| 5. Verification of small-value transactions | 1 month of real-time operation with minimal capital and low lot size | Average R difference within 20% of the benchmark compared to the demo |
Only an EA that has passed all five stages will be eligible to operate officially. Any attempt to shorten the stages is the beginning of all losses.
BrokersConfirms' view
The fact that broker firms most often encounter when reviewing the Korean EA trader environment is:, "The overwhelming majority of cases are where a company has deployed an EA based on the results of a test run, only to see the average R value turn negative within the first 1-3 months and the operation be terminated."This is not a matter of EA code skill or strategy selection — it is the result of failing to weed out the five major pitfalls (overfitting, Look-Ahead Bias, missing transaction costs, survival bias, and differences in trading environment) during the verification phase. Shortening the verification process is the beginning of all EA failures, and following the five-step process of Walk-Forward Analysis + Multiple Currency Pairs + One Month of Demo Trading + One Month of Low-Volume Trading with Real Money is the only defense.
To summarize the flow of operating a real-life EA in a single line — (1) Possesses a validated buy expectation value system verified by 11 trading days → (2) Packages that system into MQL4 and MQL5 code → (3) Includes 5 safety features such as Magic Number, duplicate entry prevention, spread filter, and time filter → (4) Performs basic verification with a single currency pair test → (5) Verifies robustness with multiple currency pairs + Walk-Forward → (6) Operates for 1 month with demo trading → (7) Verifies for 1 month with small-scale real-time trading → (8) Fully operational + quarterly system improvement with automatic extraction of trading logs. This 8-step process transforms an EA from a gambling tool relying on luck into a proven automated trading system.
But here there is a special crucial clue for EA traders only. All verification and operation by EA only have meaning when the exchange infrastructure supports it. While ordinary manual traders can partially circumvent the shortcomings of exchanges by their own judgment, an EA operates according to its code, so the flaws in the exchange infrastructure are reflected in their profits and losses.
- Whether VPS is provided for free — VPS is essential to operate the EA stably 24/7. If the exchange provides a free VPS, it saves $20 to $50 per month + it is automatically assigned to a location close to the exchange server, reducing latency.
- Stop Level policy — If the exchange forces Stops Level too high, the 9-minute precision stop-loss and the 15-minute scalping EA themselves will be impossible to operate.
- Real-time spread stability — The difference between the average spread assumed in the backtest and the actual trading spread should be small so that the backtest results of the EA are reproduced in the actual trading as well.
- Support for EA and Hedging modes — The hedging strategy of the MQL4 EA does not work in the Netting mode exchange; you must choose a trading exchange that explicitly supports the Hedging mode.
- API stability and query frequency — Volatility range: OrderSend failure rate varies by exchange by more than 5 times. News determines the fate of trading and HFT EAs
- MetaQuotes official partner status — Some exchanges have institutional-level partnerships with MetaQuotes, such as the so-called Ultency integration, which directly impacts the stability of the MT4 and MT5 servers, the depth of LP connections, and the priority of APIs.
This EA-friendly infrastructure is a testament to the exchange's commitment to innovation. Multi-tier global licensing structure, operational history, direct connection to institutional liquidity providers, deep official partnership with MetaQuotes, VPS and API policiesIt is determined by factors such as the multi-layered licensing structure of countries like Australia’s ASIC, Cayman Islands’ CIMA, Vanuatu’s VFSC, and the accumulated operational history since its establishment in 2009, as well as its recent rise to become a Tier-1 liquidity provider through the MetaQuotes Ultency integration. Vantage MarketsThe case study is an example that shows what kind of infrastructure is needed to ensure that EA test results are replicated in real-world settings.
The FX Margin Trading series continues with 15 episodes; covering everything from market structure to chart analysis, risk management, order execution, logbook verification, platform usage, market duality, trading psychology, and this episode’s EA/algorithm trading—all the way to the trader’s real-world workflow and the tools that automate it. After coding the system you tested in your 11th logbook into MQL4 and MQL5, and filtering out the five major pitfalls in the 15th episode using Walk-Forward Analysis, you can then proceed to demo and small-scale testing—and the average R-positive EA will start accumulating real profits in your account.
Next [Episode 16 of FX Margin Trading]In Korea, Korean traders must be aware of all FX trading activities, including EA. Financial regulation and the legal status of FX margin tradingThis article covers the legal status of FX margin trading in South Korea, the classification of over-the-counter derivatives in CFDs and FX, the legal methods of trading, considerations when using offshore exchanges, and changes in financial regulations and risks — we will continue to outline the legal safeguards traders must check before entering the market in the next article.




