Exporting

Convert MT5 to Pine Script

Turn MetaTrader 5 (MQL5) into TradingView Pine Script

Already have an MQL5 Expert Advisor or indicator? Paste it into the converter and HorizonAI rewrites it as Pine Script. Built the strategy in Horizon instead? Don't convert — export from the chat header.

The dedicated converter is a Pro and Elite feature. The same page converts in every direction across Pine Script, MQL5, and NinjaScript.

One-click converter

  1. Go to app.horizontrading.ai/convert
  2. Paste your MQL5, drop a file, or load an example. Correct the detected language if needed.
  3. Under Convert to, choose TradingView, then click Convert to TradingView.
  4. The result opens in a chat. Click Copy Code and paste it into TradingView's Pine Editor.

Pick Premium for the highest-quality result, or Basic to spend fewer tokens.

Open Converter →

Horizon strategies are one-way. Export out of Horizon to all three platforms; nothing converts back into Horizon. See Exporting from Horizon. Going to NinjaTrader instead? See Convert to NinjaScript.

Convert inside the chat (alternative)

Prefer to talk it through?

  1. Click New Script and set the platform pill to TradingView (the language you want to end up with).
  2. Paste the MQL5 into the box.
  3. Type: "Convert this MetaTrader 5 (MQL5) code into Pine Script."
  4. Click Start building →. Copy the Pine Script when it lands.

Mention whether the source is an indicator or an Expert Advisor, plus any timeframe or input defaults you want exposed.

After it converts

Paste into the Pine Editor and click Add to chart. If TradingView errors, paste them back into the chat and ask HorizonAI to fix.