Skip to main content

Script Converter now runs MQL, EasyLanguage and AFL natively — and draws on the chart

MQL4/MQL5, EasyLanguage and AFL indicators are no longer approximated: each language now has its own interpreter that runs the script the way it was written. Scripts in every language can draw lines, labels, boxes and tables, and Pine Script gains user-defined types, candle plots, bar colouring and alerts.

Pine Script converted into a chart-ready indicator in the TradersWeek terminal

Run the script as written

MQL, EasyLanguage and AFL are procedural languages. A script runs once over the whole history with its own loops, writes into buffers at any index and calls its own functions. Until now we translated those scripts into a bar-by-bar form, which worked for simple indicators and drifted on anything clever. Each of the three now has its own interpreter that executes the script the way its author wrote it, so classic indicators like Custom MA, Bands, Parabolic, ZigZag or MACD come out matching the original.

Converting to another language works as before: any script can still be exported to the other five of Pine Script, MQL4, MQL5, MetaStock formulas, EasyLanguage and AFL.

Drawings in every language

Many indicators don't just plot a line — they mark levels, label swings and draw tables. Those now appear on the chart:

  • Pine Script: line, label, box, table, linefill, polyline and chart.point;
  • MQL: chart objects by name — trend lines, rays, rectangles, triangles, Fibonacci, text, arrows and labels;
  • EasyLanguage: trend lines, text and arrows (TL_, Text_ and Arw_ functions);
  • AFL: PlotText and the Gfx text functions.

Drawings are shown on the chart but are not carried over when you export a script to another language.

More of Pine Script

  • User-defined types, methods and arrays of objects.
  • plotcandle and plotbar draw their own candles and OHLC bars (MQL5 DRAW_CANDLES/DRAW_BARS and AFL PlotOHLC too), and barcolor recolours the bars themselves.
  • alertcondition() and alert() fire in your browser, as a notice with a sound, once per closed bar.
  • The standard ta library is compiled from its actual open-source code, and six more widely used libraries are built in: ZigZag, TechnicalRating, RelativeValue, ValueAtTime, Color and RiskMetrics.

Paste a script into Script Converter in the terminal. A free account gets five conversions a month; Pro and Premium are unlimited.