Solutions Discover eTrader Launch your Broker Launch your Prop Firm Company Home Blog Where We Work Legal Center Contact
Platforms & White-Label

Moving a MetaTrader Robot to eTrader: A Practical Rewrite Guide.

No converter turns an MQL5 expert advisor into a Tide robot. Here is how to rewrite one by hand without losing the logic that made it work.

By September 19, 2026 9 min read

There is no button that turns an MQL5 expert advisor into a working eTrader robot. Anyone who tells you otherwise is selling something. eTrader robots are written in Tide, eTrader's own language, and a robot built for MetaTrader has to be read, understood and rewritten line by line. This is a guide to doing that rewrite without losing the logic that made the original robot worth keeping.

We build eTrader and Tide, so take the source into account, but the MQL5 side of this guide is drawn from MetaQuotes' own documentation, and the rewrite steps are the same ones we would give a trader moving to any new platform.

Before you rewrite a line of code

Print or paste the whole expert advisor and mark three things on it: every input parameter the trader is expected to set, every indicator it reads, and every place it sends, modifies or closes an order. Most MQL5 robots are shorter than they look once you strip out the boilerplate every expert advisor carries, the input declarations, the OnInit and OnDeinit handlers and the magic number bookkeeping used to tell one robot's trades apart from another's on the same account.

Run the original on its home platform first, if you still can, and save a backtest report. That report is your acceptance test. A rewrite that cannot reproduce the same trades on the same historical prices is not a faithful port, it is a new robot that happens to share a name.

The two languages side by side

MQL5's own documentation describes its syntax as "similar to the syntax of C++," an object-oriented language built for writing expert advisors, custom indicators and scripts that run inside MetaTrader 5. An expert advisor is structured around event handlers, OnInit when it is attached to a chart, OnTick on every price update, OnDeinit when it is removed, with indicator values fetched by requesting a handle once and copying values out of a buffer on each tick.

Tide reads differently by design. The manual's own line is that anyone who has written JavaScript, Python, Swift or C can read Tide the same day. There is no handle-and-buffer step: an indicator is a value assigned once, for example let trend = ema(close, 50), and the trading engine keeps it current on every new candle without the script asking for it again. Tide also gives price and lot values their own types, so a stop-loss distance can never be passed where a trade size belongs. The manual is direct about why: passing a volume where a price belongs is, in its own words, the most common way an automated strategy loses money, and in Tide that mistake does not compile.

Mapping the pieces

MQL5 conceptWhat it doesTide equivalent
OnInit()Runs once when the expert advisor is attached to a chartCode that runs at the top of the strategy, before the first candle is processed
OnTick()Runs on every price updateThe main strategy body, which the eTrader Code runtime re-evaluates on new data
Indicator handle plus CopyBufferRequest a handle once, then copy values out of a buffer on each tickA single assignment such as let trend = ema(close, 50), always current
Input parametersDeclared with the input keyword, editable when the robot is attachedNamed parameters set when the robot is switched on in eTrader Code
Order send with stop loss and take profitA trade request structure with price, sl and tp fields, sent through OrderSend or the CTrade classtrade.buy(volume, sl: symbol.ask - 40 * symbol.pip, tp: symbol.ask + 90 * symbol.pip), with named arguments
Magic numberAn integer tag used to tell one robot's orders apart from another's or from manual tradesNot needed; each Tide robot's orders are tracked by the platform automatically

Rewriting the entry and exit logic

Start with the indicators, since almost every mistake in a rewrite traces back to a mismatched calculation rather than a mismatched order. If the original uses a 50-period exponential moving average on closing price, write ema(close, 50) and check the first twenty or so values against the source platform's own indicator window on the same symbol and timeframe before touching the order logic at all.

Move to entry conditions next, keeping the same comparisons and the same bar count the original used, since an off-by-one on which candle a condition checks is the single most common source of a rewrite that backtests differently from the original. Stop loss and take profit come last, written as explicit prices with Tide's named arguments rather than as separate modify calls, which removes a whole category of MQL5 bugs where a stop loss is set on one line and can silently fail to attach on another.

eTrader Code's editor flags problems as they are typed rather than at compile time only, and every strategy backtests on the firm's own real price history before it is allowed to run live, which catches a wrong pip value or a reversed comparison earlier than a MetaTrader compile-and-run cycle typically does. Our guide to eTrader Code and cloud robots covers how a finished robot runs after the rewrite is done, and the side-by-side of Tide and MQL5 goes deeper into the language differences than this guide has room for.

What does not carry over at all

A robot's edge, if it is genuinely a small library of proprietary indicators bought from the MQL5 Market or a third-party vendor, does not carry over: nothing automatically converts an MQL5 program someone else wrote and does not want copied. Any robot depending on Windows API calls, DLL imports or file access outside the standard library will need those parts replaced entirely, since Tide runs in SGHK's cloud with no access to a local file system by design. Multi-symbol expert advisors that scan a whole watchlist from one chart need restructuring too, since Tide's model is built around one instrument's own price series rather than array loops across dozens of chart objects.

Testing the rewrite

Backtest the Tide version on the same symbol, timeframe and date range as the original's report, using eTrader Code's own history, and compare trade count, win rate and the equity curve shape rather than expecting identical numbers to the pip. Different price feeds mean different fills even with identical logic. Once the shape matches, run it in Signals only mode on a demo account for a week or two before switching it to Trade mode, and only then move it to a live account.

Traders who do not want to write code at all can skip this whole process and build an AI Trader from blocks in eTrader AI instead, wiring rules and limits together rather than porting a script, a route we cover in our guide to building indicators without starting from MQL5.

"We tell every trader the same thing before they start: budget more time for the rewrite than they expect, and test it against the old robot's own numbers before they trust it with real money."

— The SGHK Team

Key Takeaways

Frequently Asked Questions

Can I import an MQL5 expert advisor into eTrader automatically?

No. There is no automatic converter from MQL4 or MQL5 to Tide. A robot has to be read and rewritten by hand, mapping its indicators, entry rules and order logic into Tide's own syntax.

How is Tide different from MQL5 to actually write?

MQL5's own documentation describes its syntax as similar to C++, with indicator values read through a handle and a buffer. Tide reads closer to JavaScript, Python or Swift, and an indicator is a single typed value the platform keeps current, with prices and lot sizes kept as separate types so one cannot be mistaken for the other.

How long does a typical rewrite take?

It depends on how many indicators and order-management rules the original robot has, but the indicator logic is almost always the slowest part to get exactly right. Budget time to check early indicator values against the source platform before writing any order logic at all.

Do I need to know how to code to automate on eTrader?

No. Traders who do not code can build an AI Trader from blocks in eTrader AI instead of writing a robot in eTrader Code, wiring together rules such as checking the news or a daily loss limit before an order goes in.

Where can I test a rewritten robot before going live?

eTrader Code backtests on your firm's own real price history, and every robot can run in Signals only mode, sending its calls as push notifications instead of placing orders, before it is switched to Trade mode on a demo or live account. Book a demo to see the editor and the backtester on a live feed.


About SGHK

SGHK is a FinTech company that designs and builds its own software for the trading industry: the eTrader trading platform, Launch your Broker and Launch your Prop Firm. Every product is written, hosted and supported in-house and licensed to trading firms, with the CRMs branded to them, all hosted by us in the cloud, managed by each firm and built to scale across clustered servers as our clients grow. Everything is encrypted, and each firm is the only one with access to its data and its clients' data.

Your Own Trading Firm, Live in 24 Hours.

SGHK builds the technology behind brokers and prop firms: trading platform, CRM, client portal and payment rails, one bundle, one vendor. Book a call and see it working, or keep reading the guides.

More in Platforms & White-Label