Skip to main content

Studio · Product guide

Import a TradingView Pine Script strategy

Bring an existing Pine Script and let Merit AI rewrite it in Python.

Before you begin

A Pine Script strategy (a strategy(...) declaration) of up to about 6,000 characters once comments are removed. An indicator() script works too, but Merit AI will ask when to buy and sell.

Step-by-step instructions

Screenshots are examples. Your balances, limits, availability and status may differ.

  1. In TradingView, open the Pine Editor, select all of your strategy’s code and copy it.

  2. On the Studio home page, choose Import Pine Script and paste the code. Studio shows whether it found a strategy, its Pine version and its length. Comments and drawing lines (plot, label, alert) are removed because they never change trades.

  3. Pine Script stores no market or timeframe, so pick the market and timeframe to test on, check the project name, then choose Translate to Python.

  4. Merit AI translates the inputs, indicators, entries and exits into a Merit Strategy SDK version 1 and lists anything it could not translate under Translation notes. Review the rules and risk it shows.

  5. Run a backtest. Results can differ from TradingView because Studio uses platform costs, next-event fills and its own market data, so compare the trade list rather than expecting identical numbers.

What you should see

A project with a Python version 1 that follows your Pine Script’s rules, ready to backtest.

If something goes wrong

request.security on another symbol or timeframe, pyramiding, intrabar or tick options and alerts do not translate one to one; Translation notes say what changed. If the script is too long, remove unused functions or plots and paste it again.

Contact support
The translation uses your Merit AI allowance, and the cost is shown before it runs. Your Pine Script never runs on MeritFunded; only the Python version is tested and can run as a bot.
Open StudioProduct manual · Follow the current status and rules shown in your account