Codes converter (Meta Trader & Pine scripts)

Sign in to start converting.

Sign in to use the converter

The converter is for subscribers. Sign in, or create an account and subscribe on the home page.

Your subscription is not active

Subscribe for $35/month (100 conversions) on the home page. Your History is kept and stays available.

Subscribe on the home page

Everything the converter does

The same engine as the Pine2MQL Converter 2.0.1 Windows app (built-in converter, no AI).

12 conversions

  • Pine Script → MQ4 indicator / MQ5 indicator
  • Pine Script → MQ4 Expert Advisor / MQ5 Expert Advisor
  • MQ4 indicator → MQ4 Expert Advisor
  • MQ5 indicator → MQ5 Expert Advisor
  • MQ4 indicator → MQ5 indicator, and MQ5 indicator → MQ4 indicator
  • MQ4 Expert Advisor → MQ5 Expert Advisor, and MQ5 Expert Advisor → MQ4 Expert Advisor
  • Merge 2 indicators (Pine, MQ4 or MQ5, any mix) → one MQ4 or MQ5 indicator
  • Built-in rule-based converter: instant, no AI, the same engine as the Windows app

Every EA includes (all adjustable in MetaTrader)

  • Trade: lot size, money management with risk %, maximum open orders at a time, close on opposite arrow, hedging, invert trades
  • Exits: take profit, stop loss, trailing stop (trail after / stop / step), partial close of a % of the lot at every ATR × multiplier of profit
  • Timing: initial delay after each order (no SL/TP, trailing or close before it), delay before the next order, trading hours, trading days, close outside hours
  • Other: magic number, slippage, max spread, trade comment
  • Dashboard on the chart: spread, last signal, session, countdowns, every open order with SL/TP/P&L and its state, today's closed orders, last 5 closed orders, balance and equity
  • Plot indicator: the EA draws the indicator's lines and arrows on the chart
  • All the indicator's own settings become EA inputs. The indicator logic is inside the EA
  • Set your own default EA settings once; they are saved in your account

Signals

  • Non-repainting: only closed bars are calculated; EAs read the signal once per new bar
  • Pine → EA: auto-detected from strategy.entry, alertcondition, plotshape / plotarrow, or your own "Buy when / Sell when" conditions
  • MQ indicator → EA: arrow buffers, line cross, level cross, slope change or value sign, with signal bar for Fractals-type arrows; the indicator's buffers are listed for you

MQ4 ↔ MQ5 conversions

  • Keeps the original code and logic; a compatibility layer recreates the other platform's functions
  • MT4 → MT5: OrderSend/OrderSelect/OrdersTotal on MT5 positions, Close[]/Time[] arrays, timeframes, iMA(…, shift)-style calls, SetIndex… drawing, MT4 error codes
  • MT5 → MT4: indicator handles + CopyBuffer, positions/orders/deals, CTrade, CPositionInfo, COrderInfo, CSymbolInfo, CAccountInfo, plot properties, input groups
  • Tested on 320 real files: 318 compiled with 0 errors

Pine translator

  • Pine v4, v5 and v6: indicator / study / strategy, input.*, var, :=, if / for / while, history [x], ternaries, user functions with tuple returns
  • ta.*: sma, ema, rma, wma, hma, vwma, alma, linreg, stdev, rsi, atr, macd, bb, kc, stoch, cci, dmi, supertrend, mfi, wpr, obv, crossover/crossunder, pivots, barssince, valuewhen and more; math.*, nz, na, fixnan
  • plot, plotshape, plotchar, plotarrow, hline, alertcondition, alert, strategy.entry
  • Multi-timeframe request.security (non-repainting) and other-symbol inputs
  • Unsupported parts are reported with the exact line

Online extras

  • History tab: every conversion is recorded with date, type, settings, notes, source and result files. Open, copy or download them again at any time
  • Open files from your PC, paste, copy, download .mq4 / .mq5 or all files as a .zip
  • Subscription tab: plan, renewal date, days left, conversions used and remaining
  • Compile the downloaded file in your MetaEditor (F7) — every result is ready to compile

Sign in