Choosing between MetaTrader 5 and Python at Interactive Brokers looks like a software decision, but it changes three more important things: what is traded and who is on the other side, where the strategy can live, and how several strategies run in one account. The first is decided by the broker, not the platform: a CFD is a contract with the provider; a share or a future bought on an exchange sits in the holder’s account. The same questions apply to any exchange broker with an API; this comparison uses Interactive Brokers.
The short answer
Can a complex model, with several assets and several data sources, run in MQL5? Yes, with work. An Expert Advisor can trade several symbols and read data from files or the web; a model from XGBoost, scikit-learn or PyTorch is trained in Python and run in the terminal in ONNX format, with its variables rewritten in MQL5. Each extra source and each retrain is integration work, and what gets traded is whatever symbols the broker sells.
Can it have portfolio risk measures and controls? Yes, but they must be programmed. MetaTrader 5 provides the account’s positions and a number that identifies each strategy’s orders; shared limits (the day’s loss, total exposure, leverage) and a book per strategy are left to build and test.
When is MetaTrader 5 the better choice? When the strategy uses technical indicators on a few symbols, a free built-in tester and optimiser matter, one wants to follow the account from a phone or leave the robot on a hosting service, or the markets wanted are only available at a MetaTrader broker.
When is Athena QS Console the better choice? When there are already several Python strategies, with their own models and data, to run as one portfolio at Interactive Brokers, in US stocks, CME Group futures and spot currencies in one’s own account. Console brings ready-made what would otherwise have to be programmed: a book per strategy, 11 checks on the whole portfolio before every order, internal crossing of opposite orders and reconciliation with the broker. In exchange, it is paid, runs only on Windows and has no backtester; adapting each strategy to its Python class usually takes under an hour, and one can start on the paper account with the same licence.
1. What is traded, and who is on the other side
MetaTrader 5 is software; what gets traded is decided by the broker that offers it. Many MetaTrader 5 brokers sell CFDs, but others connect it to an exchange: in Brazil, XP Investimentos launched it in 2014 for Brazilian stocks and futures, and in the United States AMP Futures, a registered futures broker, has offered it since 2017 for CME Group futures. A CFD, or contract for difference, pays the change in an asset’s price without delivering the asset: what is held is not the share but a contract with the provider, which is the counterparty. Even Interactive Brokers, which offers CFDs outside the United States, explains that on its share CFDs it is the counterparty, that they are not cleared through an exchange or a clearing house, and that whoever trades them therefore bears its credit risk.
With a share or a future bought on an exchange, by contrast, the account holds the share or the exchange’s contract, and a clearing house stands behind settlement. Console trades US stocks and CME Group futures (today the E-mini S&P 500, the E-mini Nasdaq-100, the 10-year Treasury note, WTI crude, gold, copper and the euro) in the user’s own account at Interactive Brokers, plus spot currencies. Spot currencies don’t trade on an exchange: Interactive Brokers is the counterparty to each trade, but the trade settles into the currencies themselves, which stay in the account. Console doesn’t trade CFDs.
The same pair can be traded two ways: a euro future has an expiry and a multiplier; a spot trade changes the balances of the two currencies. Before comparing platforms, it’s worth knowing which of the two the strategy needs.
When the provider is the counterparty, three things matter:
- A conflict of interest. In 2016, the UK regulator, the FCA, warned that the risk of conflicts increases when a firm doesn’t hedge its clients’ trades and benefits directly from their losses, which gives it an incentive to offer more leverage. In a sample of accounts at eight providers, over 80% of clients lost money over a year. Today, in Europe and the United Kingdom, every provider must publish what percentage of its own accounts lose money.
- The limits regulators impose. In the European Union, since 2018 (first under an ESMA measure and, since 2019, under each country’s own measures), retail CFD leverage has ranged from 30:1 to 2:1 depending on the asset, with negative-balance protection and a mandatory warning showing the percentage of accounts that lose money with each provider. In the United States they are not banned as such, but the law requires these contracts, with investors who are not eligible contract participants, to trade on a registered exchange; since CFDs don’t, a retail investor can’t trade them in practice.
- The provider’s strength and supervision. If it fails, the protection of the money depends on the laws of the country where it is regulated. In Chile, the CMF publishes alerts about platforms that are not registered or authorised there and recommends checking on its website whether a company is supervised before investing.
2. Where the strategy lives: MQL5 or Python
In MetaTrader 5, an automated strategy, an Expert Advisor, is written in MQL5, the platform’s language. MQL5 has no libraries such as XGBoost, scikit-learn or PyTorch: a model of that kind is trained elsewhere, for example in Python, exported to the ONNX format and run inside the terminal. The variables that feed it must be computed in MQL5 exactly as they were computed in training, and every retrain means exporting it again. With its matrices, MQL5 can also be used to program and train simple models by hand. MetaQuotes additionally offers a Windows-only Python package that reads data and sends orders through the terminal; in that case the logic runs outside MetaTrader. Either way, the account holds whatever the MetaTrader broker sells, and limits across strategies are left to program.
In Console, the strategy is a Python class, and the whole Python ecosystem runs inside it: re-estimating a model every day, solving an optimisation, using statistical models that don’t export like a neural network, or deciding with data from many sources (company financial statements, economic series, sector data) and with its own estimates, such as the market regime or volatility. Console supplies Interactive Brokers’ prices, and each strategy connects whatever other sources it needs; it’s worth recording when each data point became available.
A single strategy can also trade several assets at once: statistical arbitrage between two stocks, estimating their relationship with models such as cointegration, or a stock portfolio hedged with the index future. In Console, each leg is a stock, a CME Group future or a spot currency in the user’s own account, not a CFD; its example strategies include a pairs strategy. Before trading, test what happens if one leg fills and the other doesn’t.
The difference matters little for a strategy built on technical indicators, and a great deal when the model changes with the data or depends on information other than price.
3. Several strategies in one account: netting, hedging and books
MetaTrader 5 tracks positions per account in one of two modes, set by the broker: «netting», one position per symbol, or «hedging», several per symbol, each with its own number. Each Expert Advisor can tag its orders with another number, the «magic number», to recognise its own. In hedging mode, each strategy can hold and close its own positions without touching another’s, at the cost of keeping opposite positions open, each with its own financing. Coordinating limits across several strategies is left to whoever programs them.
In netting mode, as at Interactive Brokers, which has no hedging mode, the account holds a single net position per symbol, even when several strategies trade it. That is where the risk lies: if two strategies trade the same asset, one’s correct close can undo the other’s position. It happened to Athena while building Console; the case is in why algorithmic trading needs its own risk controls. That is why, when several strategies share an account, each needs its own book, and every close must be capped at what belongs to it.
Console is built for several strategies in one account: each with its own book, the same checks before every order across the whole portfolio, opposite orders crossed internally, and the books compared with the broker: positions every two minutes, executions every ten and the day’s result, to the cent, every night.
Can MetaTrader 5 be used with Interactive Brokers?
Yes, though not as one of the broker’s own platforms. Interactive Brokers offers Trader Workstation, IBKR Desktop, its portal, its apps and its API; MetaTrader 5 isn’t among them. Its documentation says an account can connect to MetaTrader 5 through third-party connections. There are two routes: a broker that offers MetaTrader 5 connected to Interactive Brokers through a gateway, such as the one MetaQuotes and oneZero announced in 2016, or a bridge program that carries MetaTrader’s orders to Trader Workstation. Before using either, it’s worth knowing which account the positions sit in, who maintains the bridge and how MetaTrader’s positions are compared with the broker’s, and testing on a paper account what happens to an order if the bridge goes down after it is sent and before it is confirmed.
What MetaTrader 5 does well
- It is free for the trader: the broker provides it.
- It has a built-in strategy tester, with optimisation, forward testing and computation spread over a network of computers.
- It has a very large community, a marketplace of robots and indicators, and versions for Windows, macOS, the browser and mobile.
- Its robots can run on MetaQuotes’ hosting, with no computer of one’s own switched on, from USD 10 a month, and send alerts to the phone.
- Depending on the broker, it covers many markets: currencies, indices, commodities, stocks and futures, through CFDs or on an exchange.
- It can connect to Interactive Brokers through third-party connections, according to the broker’s own documentation.
Console, by contrast, is paid, runs only on Windows with Python, and trades US stocks, CME Group futures and spot currencies at Interactive Brokers, on one-minute bars or longer. Research and testing happen in Python, with each user’s own tools; plan mode works out orders without sending them, and Interactive Brokers’ simulation accounts allow testing without putting capital at risk, although simulated execution may differ from live.
Comparison
Athena develops and offers Console; what is said here about the other options comes from their public documentation, checked on 3 November 2026.
| Aspect | MetaTrader 5 | Own Python at Interactive Brokers | Athena QS Console at Interactive Brokers |
|---|---|---|---|
| What is traded | Whatever the broker sells: CFDs or, with some brokers, exchange-traded stocks and futures | What Interactive Brokers offers: stocks, options, futures, currencies and bonds on many exchanges | US stocks, seven CME Group futures and spot currencies, in the user’s own account; no CFDs |
| Language, models and data | MQL5; Python models via ONNX, with their variables rewritten in MQL5; data from the web or files; several symbols per Expert Advisor; or Python outside the terminal | Python, with any library and data source | Python, with its libraries and data sources inside the strategy; several assets per strategy |
| Several strategies | Account positions; in hedging mode, each strategy can keep its own; shared limits must be programmed | One net position per contract; books, limits and reconciliation must be programmed | A book per strategy, portfolio checks, internal crossing and reconciliation, already built |
| Testing | Built-in tester and optimiser | Each user’s own tools, or an engine with backtesting | In Python, with each user’s own tools; plan mode and simulation accounts |
| Cost | Free: the broker provides it; MetaQuotes hosting from USD 10 a month | Free API; the cost is building and maintaining the operation | Plans from USD 29 a month + VAT; adapting each strategy to Console’s class, which usually takes under an hour |
| Where it runs | Desktop terminal or MetaQuotes hosting; browser and mobile for monitoring and manual trading | Wherever Python and Trader Workstation or IB Gateway run | Windows, on the user’s own computer, with Trader Workstation or IB Gateway |
The options for running Python at Interactive Brokers, from a library to a ready-made application, are compared in the deployment guide.
Questions for choosing
- What stays in the account: the asset or a contract with the provider?
- Which account do the positions sit in: one’s own or an intermediary’s?
- Who is on the other side of the trades, and does it hedge them?
- Where is the provider authorised, and what protects the money if it fails?
- What language is the strategy written in, and what data and models can it use?
- How are several strategies and their limits coordinated?
- What does it cost, and where does the provider make its money?
Athena QS Console
Athena QS Console runs Python strategies at Interactive Brokers as one portfolio: a book per strategy, a control before every order and the books compared with the broker. Athena uses it with real capital. The user installs and operates the software.
Explore Athena QS Console →Questions and answers
Is trading CFDs safe?
It carries risks a share doesn’t. Whoever trades a CFD takes on the provider’s credit risk, and a provider that doesn’t hedge its clients’ positions benefits from their losses; leverage also magnifies losses. In 2016, in a sample of eight providers the FCA reviewed, over 80% of clients lost money over a year; today, in Europe and the United Kingdom, every provider publishes its own percentage. It’s worth checking where the provider is authorised and whether it hedges.
Are CFDs banned in the United States?
Not as such. The law requires these contracts, with investors who are not eligible contract participants, to trade on a registered exchange; in practice, a retail investor can’t trade them.
Can MetaTrader 5 use machine learning?
Yes, with extra work. A model from XGBoost, scikit-learn or PyTorch is trained in Python, exported to the ONNX format and run inside the terminal, with the variables that feed it computed in MQL5 just as in training. MQL5 can also be used to program and train simple models by hand. With MetaQuotes’ Python package, the strategy can also run in Python, outside the terminal.
Sources
- FCA (United Kingdom), CP16/40: conduct of firms offering CFDs to retail clients (2016)
- ESMA: final product intervention measures on CFDs and binary options (2018)
- United States: Securities Exchange Act, section 6(l)
- United States: Commodity Exchange Act, section 2(e)
- Interactive Brokers: share CFDs (counterparty and credit risk)
- Interactive Brokers: connecting MetaTrader 5
- MQL5: ONNX models
- MQL5: Python integration
- MQL5: the hedging position system
- MetaTrader 5: strategy tester
- Interactive Brokers: trading platforms
- CMF (Chile): unregulated platforms and entities (6 May 2026)
- MetaTrader 5, XP Investimentos launches MetaTrader 5 for Brazilian stocks and futures (2014)
- MetaTrader 5, AMP Futures offers MetaTrader 5 for CME Group futures (2017)
- MetaTrader 5, MetaQuotes and oneZero gateway to Interactive Brokers (2016)
- MQL5, MetaQuotes hosting
- MQL5, machine learning with matrices
Newsletter
Stay up to date with Athena's publications and market insights.
Athena Quantitative Strategies is a quantitative investment firm based in Santiago, Chile: it manages portfolios, publishes its market analysis and offers the software it uses to trade and research. Athena Quantitative Strategies is not registered in the CMF's Register of Portfolio Managers and is not supervised by it. This content is educational and informational; it is not investment advice, a recommendation or an offer of securities. All investing involves risk, including loss of capital.
