Translate trading strategies between MetaTrader and TradingView

Stratlate is a free structural transpiler between MQL4/MQL5 and Pine Script v6 — both directions. It maps the common subset of both languages and reports the constructs it knows it cannot translate. It then goes further: where it can, it runs your script and the conversion on the same bars and compares the numbers, because a construct can map perfectly and still compute the wrong value.

MQL4 → Pine v6 MQL5 → Pine v6 Pine v6 → MQL4/MQL5 History deleted after 12 months
Start converting
Source — MQL5
Imported library source (optional)

If your Pine script has an import user/library/1 as x line, paste that library's source here so its functions are converted with the script. TradingView libraries cannot be fetched by the converter.

Output — Pine Script v6
  1. Pre-flightwaiting
  2. Convertwaiting
  3. Check against originalwaiting
  4. AI reviewwaiting
What these results do and do not promise

A grade is about mapping. CLEAN means every construct had an equivalent — not that the numbers come out the same. We have found defects in our own engine where a mapped construct computed the wrong value and nothing warned about it; that is precisely why the measurement below exists.

A measurement is about values, on our execution. "Verified" means we ran your script and the conversion on the same bars and the numbers matched. We execute both languages ourselves, to the published TradingView and MetaQuotes semantics; we do not yet run a live TradingView chart or a MetaTrader terminal. So it shows the two scripts agree with each other, not that either matches your broker's ticks, spread or fills.

"Not verified" is not a failure. It means we could not measure that script exactly, and we would rather say so than publish a number you would read as evidence. The output and its warnings are unaffected.

Always compile and backtest before risking money. The platforms differ in ways no converter can remove: MetaTrader evaluates every tick, TradingView on bar close; order execution, spread and position models are not the same.

Provided as is. Review, compile and backtest before trading — accuracy is not guaranteed. Terms

Warnings & errors
  • Run a conversion to see warnings here. Constructs the engine knows it cannot map are listed with their line number.

Built for porting, not pretending

Measured, not just mapped

Constructs with no equivalent are flagged with their line number, not faked. And because a mapped construct can still compute the wrong number, Stratlate runs both scripts over the same bars and compares the values — and says so plainly when it cannot.

Serverless, and kept only for you

Your code is converted in memory and kept only so your allowance can be counted and your history exists. It is never sold, published or shared, and is used only by us, to test and improve the converter itself. Records delete themselves after 12 months. What is kept, exactly.

Made for traders porting strategies

Moving averages, crossovers, oscillators, bands, entry and exit logic — the constructs traders actually port are the ones Stratlate translates best, in either direction. Drawing idioms and broker plumbing are where it says no.

Frequently asked questions

How do I convert MQL5 to Pine Script?

Paste your MQL5 indicator or expert advisor into the source pane, set the direction to MQL5 → Pine Script, and click Convert. Stratlate produces Pine Script v6 that you can paste straight into TradingView's Pine Editor, together with a list of warnings for anything that needed a manual decision. It's a structural transpiler: it maps the shared subset of both languages and clearly flags what it can't map, rather than guessing.

Can I move an MT5 indicator to TradingView?

Yes — that's the core use case. Common MT5 building blocks like iMA, iRSI, iATR, price series and buffer plots translate directly to Pine Script's ta.* functions and plot(). Platform-specific pieces (terminal functions, broker/order infrastructure, tick events) can't exist on TradingView, so they're reported as warnings with line numbers instead of being silently dropped.

Does Pine Script to MQL5 conversion work too?

Yes. Stratlate works in both directions: Pine Script v6 → MQL5 (or MQL4). ta.sma becomes iMA, strategy.entry maps onto order-sending logic, and series indexing like close[1] becomes MQL price-array access. Pine features with no MQL equivalent — for example request.security calls or drawing-object idioms — are flagged so you can decide how to handle them.

Is the conversion perfect? Will my strategy behave identically?

No transpiler can honestly promise that, and Stratlate doesn't. MetaTrader evaluates code on every tick; TradingView evaluates on bar close by default. Order execution, spread handling and account state differ between platforms. Stratlate gives you a structural translation of the logic, an explicit list of everything that needs your judgment, and — where it can be measured — a comparison of the two scripts' actual output. Expect to review, compile and backtest the result before trading it.

What does the pre-flight check tell me?

Alongside every conversion, Stratlate runs a feasibility pre-flight that inspects your source for platform features the target language simply cannot express — DLL calls, file I/O, hedged position management and the like. The verdict tells you up front whether to expect a close translation, an approximation, or a structural skeleton that needs real work — before you read a line of the converted code. Even a BLOCKED verdict still shows you what the engine produced; the strip just tells you honestly how far to trust it.

What does “Verified” mean on a conversion?

It means the conversion was measured, not just graded. Stratlate runs your original script and the converted one over the same 500 bars of price data, bar by bar, and compares the numbers they produce — every plotted series, and for a strategy the position, the equity and the trade list. “Verified: output matches the original” means they agreed on every bar where both had a value. That is a far stronger statement than the clean-translation score next to it, which only says how much of your source the engine knew how to map: a moving average seeded differently, an array indexed the wrong way round or a period that arrived as 15 instead of 14 all map cleanly and still produce the wrong chart. Running both is the only way to catch them.

My conversion says “Not verified” — did it fail?

No. Your converted code is there and is no different from any other conversion. “Not verified” means the checker met something it will not model — a higher-timeframe request.security call, an unimplemented builtin, a strategy setting outside its fill model — and it refuses to guess rather than report an approximate fidelity number. A wrong number would be worse than no number, because you would read it as evidence. Treat it exactly as you would treat any conversion before this feature existed: review it, compile it, and backtest it.

What is the TradingView compatibility check?

After converting to Pine Script, Stratlate automatically lints the output against a catalog of known TradingView compile errors — each rule is traced to a real compiler or runtime error code (CE/RE) observed in the Pine Editor. FATAL findings would stop the script from compiling, WARN findings usually need attention, and HAZARD findings are patterns that tend to misbehave at runtime. A clean result means none of the known defects were detected — it does not guarantee the script is valid; TradingView's compiler is the final authority.

Is Stratlate free? What happens to my code?

Converting your own script requires an account, and the free plan includes 3 conversions in total; further conversions are bought in packs, and those credits do not expire. Validation, linting and feasibility checks are free, unlimited and need no account. The worked example on this page also converts for anyone, signed in or not, so you can see exactly what the engine produces before deciding to sign up. Every conversion is saved: the source you submitted, the output it produced and the warnings raised. That record is your conversion history, and it is what your allowance is counted from. It is deleted after 12 months and is never sold, published or shared. We also use stored conversions internally to test and improve the converter — a conversion that comes out wrong is the most useful thing we can look at. They are never sold, published or redistributed. The full detail is in the Privacy Notice.

Why do I have to accept the Terms of Use before converting?

Because converted code is something you may trade real money with, and no converter can guarantee it behaves exactly like the original. The Terms of Use say plainly that output is provided as is, that inconsistencies between the original and the converted script are to be expected, and that reviewing, compiling and backtesting the result is your responsibility. The box is never ticked for you: accepting is a positive act, so you confirm it each visit, and the version you accepted is sent with every conversion.