On this page
- What an algorithm is, and is not
- What an Expert Advisor is
- Backtesting and its pitfalls
- Overfitting
- Latency and a VPS, in plain words
- What goes wrong in operation
- A worked example
- What this page does not tell you
- At GIO4X
- Questions
- Related pages
Also searched aswhat is an Expert Advisor · backtesting pitfalls · overfitting in trading · do I need a VPS for trading
What an algorithm is, and is not
A trading rule has a condition and an action: when this is true, do that. A complete set also says how much to trade and when to get out. Written precisely enough for a computer to follow, it is an algorithm.
Automation removes hesitation, inconsistency and fatigue. It does not remove risk, and it adds some of its own: a program repeats a mistake as faithfully as it repeats anything else.
The term covers a wide range. Large institutions use algorithms mainly to carry out big orders in small pieces. What an individual meets is usually a rule-based strategy running on a retail platform.
What an Expert Advisor is
Expert Advisor, or EA, is MetaTrader’s name for a program that is attached to a chart and allowed to trade. It is written in the platform’s own language, MQL5 in the case of MetaTrader 5. It can read prices and indicators, and send, change and close orders.
An EA runs inside the trading terminal. It works only while that terminal is running, connected to the server and permitted to trade automatically. Its code is called each time a new price arrives.
Two neighbours are often confused with it. An indicator calculates and draws but does not trade. A script runs once and stops.
An EA bought from a stranger comes with the seller’s own test results, and they are advertising. Nobody can tell from a results table how the rules were arrived at, and that, as the next two sections explain, is the thing that matters.
Backtesting and its pitfalls
A backtest runs the rules over past prices to see what they would have done. It is useful for finding errors in the rules, for seeing how they behave, and for meeting their worst stretches before those cost anything. It misleads in well-known ways.
- The data. History may be incomplete, or built from bars with the movement inside each bar guessed. A rule that depends on what happened within a bar is then being tested on invention.
- Costs left out. Spread, commission, overnight financing and slippage are all real. A rule that makes many small trades can pass from profit to loss on the spread alone.
- Looking ahead. The test uses something that was not known at the time, such as a bar’s closing price to decide a trade made at its open.
- Fills that could not have happened: an exact price in the middle of a gap, or any size at the quoted price.
- Survivors only. A test run on instruments that exist today leaves out those that failed and were delisted.
- Too few trades. Thirty trades are an anecdote, however good they look.
- One kind of market. Rules tuned to a long quiet trend have never met anything else.
Overfitting
Optimisation tries many values for a rule’s settings and keeps those that did best. The danger is built in. Past prices are made of some pattern and a great deal of noise, and with enough attempts some combination will fit the noise by chance. It will look excellent on the past and mean nothing for the future. That is overfitting.
It shows itself in a few ways: a result that collapses when a setting is changed slightly; many settings and few trades; a line of results too smooth to believe.
The defences are habits and not proofs. Keep part of the history back, unseen, and test the chosen settings on it once: an out-of-sample test. Repeat that over successive stretches, choosing on one and testing on the next: walk-forward testing. Prefer few settings, and a broad region where results are acceptable to a single sharp peak. Then run the rules on a demonstration account, on prices that did not exist when they were written.
A rule that survives all of this has not been shown to work in future. It has only failed to be shown not to.
Latency and a VPS, in plain words
Latency is the time between the program deciding to trade and the order being executed. It is made up of the computer, the path across the network and the handling at the far end.
How much it matters depends on how long the opportunity lasts. To a rule that acts on four-hour bars, a tenth of a second is nothing. To a rule that tries to take a few points many times a day, it can be the whole result, and in that race an individual competes with firms whose machines sit beside the exchange’s own.
A virtual private server, or VPS, is a rented computer in a data centre that is always on and has a steady connection. The terminal runs there, so the EA keeps working when the computer at home is switched off or the line fails. A VPS deals with uptime and shortens the network path. It does nothing for the quality of the rules, it costs a monthly rent, and it needs looking after, since updates and restarts happen there too.
What goes wrong in operation
Real running has faults that a backtest lacks. Connections drop. Terminals restart, and a program must then work out what positions it has. An order is rejected or requoted, and the code must have an answer. A broker changes a spread, a minimum stop distance or a symbol’s name.
A program left unattended is still the responsibility of whoever started it. Methods that enlarge a position as it loses, such as martingale and grid systems, are easy to automate and can show a long smooth record before a single run of losses takes the account. An automated strategy needs watching, a limit on what it may lose, and a way to switch it off.
A worked example: the best of four hundred
Illustration · invented round figures, not market prices and not GIO4X fees
A rule has two settings. A tester tries 400 combinations of them over five years of prices, starting each run with an account of 100.
- The best combination turns 100 into 180. It is the one that would be shown in an advertisement.
- The combinations either side of it, one step away in each setting, end between 96 and 104.
- A sixth year of prices was kept back and never used in the choosing. On it, the best combination turns 100 into 93.
A real effect would not vanish when a setting is nudged, and would not reverse on data it had not seen. The 180 was the luckiest of 400 attempts: a coincidence found by searching, not a rule. Had the sixth year been used in the search as well, there would have been nothing left to reveal it.
What this page does not tell you
- Whether any rule, strategy or Expert Advisor makes money. No page can, and a backtest cannot either.
- How to program. The language and the platform’s tester are documented by MetaQuotes, the maker of MetaTrader.
- Any broker’s execution speed, server location or conditions for automated trading. Those are the broker’s to publish.
- Whether a VPS is worth its rent for you. That depends on the rule and on how reliable your own computer and connection are.
At GIO4X
GIO4X does not offer MetaTrader: its platform is 777 Raptor, and nothing is published about running a program of this kind on it. GIO4X publishes no execution-speed figure and no server location, and this website lists no VPS service, so nothing on this page describes any of them. The Rule bench on this site tests a rule on invented prices: it shows how a backtest behaves and how one good result misleads, and it is not a test of anything on a real market.
Questions people ask
- Does an Expert Advisor trade better than a person?
- It trades more consistently, which is a different thing. It applies the same rules every time without fear or boredom. If the rules lose money, it loses money consistently.
- If a backtest covers ten years, can I trust it?
- Length helps, but it does not answer the main question, which is how the rules and their settings were chosen. Ten years searched for the best of thousands of combinations says less than two years tested once on rules fixed in advance.
- Do I need a VPS to run an Expert Advisor?
- Not to run one. An EA works on any computer whose terminal is open and connected. A VPS is for keeping it running without interruption when that cannot be relied on at home.
Related pages on this site
- Rule benchLabsBuild a rule and test it on invented prices.
- 777 RaptorPlatformsThe platform at GIO4X, and what is published about it.
- Strategy libraryStrategyTwelve approaches described, martingale and grid among them.
- The Risk RoomLabsRuin, streaks and sizing, to try.
- Signal sellers and guaranteed returnsScam schoolHow a results table is used to sell.
Academy lessons on this subject
- Expert Advisors and how they runAdvanced
- Backtesting, optimisation and overfittingAdvanced
- Testing a set of rulesAdvanced
The words on this page
A general explanation for study, with an invented example. Rules, costs and terms differ by country, market, provider and product, and the documents of the thing itself are what count. Educational information, not investment advice or a recommendation to trade.
GIO4X Academy · Market primers · Written 5 October 2026
https://www.gio4x.com/primers/algorithmic-trading
Printed from gio4x.com.
