Expert Advisor: What an EA Is and How It Works
You've come up with a trading idea and you don't want to execute it by hand anymore. You want it to run automatically on a trading platform. That's exactly what an expert advisor, or EA, is for: a program that carries out the rules of your strategy on its own on the platform. In this article you'll see how an EA is built from a strategy developed in StrategyQuant X, how you can build an EA even without programming skills, and how you test it before it works with real money.
What Is an Expert Advisor?
An expert advisor, or EA, is the exported program code of a strategy you developed in StrategyQuant X, adapted for the MetaTrader 4 trading platform. You get this code from the Results area, in the Source code tab, inside StrategyQuant X. You can then place the exported code in the "experts" folder of MetaTrader 4, and from there the platform carries out the trading rules of your strategy on its own.
This description applies to exporting to the MetaTrader 4 target format. An EA doesn't replace your broker or the trading platform itself: it's the part that carries out the rules you developed earlier, right where your account sits.

Building an Expert Advisor Without Coding: the EA Wizard
Not everyone who wants to build an EA has already had a strategy developed in the strategy generator of StrategyQuant X. For anyone who wants to turn a trading idea directly into rules, there's a dedicated tool: the EA Wizard. It's a standalone tool, separate from the actual strategy generator.
In the EA Wizard you set conditions and the actions that go with them, for example when a position gets opened and when it gets closed again. This way you build an expert advisor for MetaTrader 4 without writing any code yourself.
This takes the programming work off your hands, but not the thinking about which conditions make sense. The EA Wizard doesn't create a finished strategy on its own: you still bring your own trading idea and decide how it gets translated into rules.

Testing the Exported EA in MetaTrader 4
Before an EA works with a real account, or even just a demo account, you can test it directly in MetaTrader 4. The EA exported from StrategyQuant X is built so you can run it in MetaTrader 4's own tester, or in a simulated mode, before you switch it live.
This is an additional test on the target platform, not a replacement for the backtest you already ran in StrategyQuant X. The two steps check different things: the backtest in StrategyQuant X checks the rules over a longer historical period using the software's evaluation tools, while the test in MetaTrader 4 checks whether the exported code runs the way it should on the target platform.
Here's how the three steps connect: from the strategy you developed, through the export, to the test on the target platform.

What a Test Shows You, and What It Doesn't
A passed test in the MetaTrader 4 tester shows you that the exported code works technically the way it should. It doesn't show you how the strategy will behave in the future. Both a backtest in StrategyQuant X and a test in MetaTrader 4 work with data from the past. Both methods tell you something about how the rules behaved on that past data, not about how they will behave in a future that unfolds differently.
This isn't a shortcoming of the tools, it's a property of any method that works with historical data: it can only check what's contained in the data.
What Remains: Limits and Takeaway
An expert advisor is the exported code of your strategy, whether you developed it in the strategy generator of StrategyQuant X or put it together with the EA Wizard without coding. Before it runs live, you can check it in the MetaTrader 4 tester or in simulated mode.
What an EA doesn't take off your hands is the watching: a strategy that was tested on past data remains a strategy that was tested on past data. That holds for every test you run before going live.
This article is for education only and is not investment advice. Past results, including backtests, do not guarantee future results. Trading financial instruments involves risk, and you can lose money.
This article is for education only and is not investment advice. Past results do not guarantee future results.
How do you do it? Share it in the community. Free, in your language.
Sign up free