Pine Script® → Python Converter

in Seconds

Your Pine Script code, running in Python

This is not another AI / LLM based Pine Script converter.
Instead, it's a deterministic, reliable compiler!

1,000/1,000 real TradingView scripts compile & run. See the proof

//@version=6
strategy("BarUpDn Strategy", overlay=true,
         default_qty_type = strategy.percent_of_equity,
         default_qty_value = 10)

maxIdLossPcnt = input.float(1, "Max Intraday Loss(%)")

strategy.risk.max_intraday_loss(maxIdLossPcnt,
     strategy.percent_of_equity)

if (close > open and open > close[1])
    strategy.entry("BarUp", strategy.long)

if (close < open and open < close[1])
    strategy.entry("BarDn", strategy.short)
"""
@pyne
"""
from pynecore.lib import close, input, open, script, strategy

@script.strategy('BarUpDn Strategy', overlay=True, default_qty_value=10,
                 default_qty_type=strategy.percent_of_equity)
def main(
    maxIdLossPcnt=input.float(1, 'Max Intraday Loss(%)')
):
    strategy.risk.max_intraday_loss(maxIdLossPcnt, strategy.percent_of_equity)
    if close > open and open > close[1]:
        strategy.entry('BarUp', strategy.long)
    if close < open and open < close[1]:
        strategy.entry('BarDn', strategy.short)

How It Works

Upload Your Pine Script

Paste or upload your Pine Script in the web app to convert it online, or send it from the PyneCore CLI or the API.

Upload Pine Script

We Convert to Python (PyneCore)

Our system translates your Pine Script to Python code that uses our PyneCore library. Generated code is human-readable. You can use and develop it easily.

Convert to Python

Run on Your Machine

Execute the generated Python code locally or on your own server. PyneCore allows you to run your compiled scripts easily with its friendly CLI.

Run on Your Machine

Keep Working on It in PyneIDE

Open the .pine file or the generated Pyne code in PyneIDE, run it on a chart and step through it bar by bar. Pine files recompile when they change, and the Pyne code runs without an account.

Install PyneIDE for free

Proof, Not Promises

Don't take our word for it. Pyne in the Wild takes the most popular open-source Pine Script indicators and strategies published on TradingView, compiles each one to Python, and runs it with PyneCore. Wherever TradingView's output can be exported, every plotted value and every trade is compared against it — bar by bar, bit by bit.

The remaining 0.229% of bars? Within 1e-9 relative tolerance — last-digit floating-point rounding, documented per script, because “close enough” deserves a number too. Every result is reproducible: the corpus pins the exact source of each script with a SHA-256 hash.

Browse the Full Report

Script-by-script results at wild.pynesys.io · snapshot 2026-10-24 · the corpus keeps growing

1,000
real TradingView scripts
502 indicators, 498 strategies
100%
compile and run
1,000/1,000, zero failures
99.771%
of 132 million compared bars
bit-exact vs TradingView
0
scripts diverge from TradingView
across 353,577 compared trades

Try It For Free

Not ready to subscribe yet?
Convert up to 3 scripts for free with our Discord bot.

Go to #pine-compiler-bot channel in PyneSys Discord Server and use the /pyne-help command.

Discord bot conversions support Pine Script v4, v5, and v6 files up to 25KB.

Join Our Discord
3 free conversions
Discord Bot Preview

CLI & API Integration

The PyneCore CLI is the primary interface today — run your Pine Scripts locally with a single command. For backend automation, the same compiler is exposed as an HTTP API. Pick whichever fits your workflow; both call the same deterministic compiler.

PyneCore CLI

# One-shot: compile via the API, then run locally on your OHLCV data
pyne run my_strategy.pine BTCUSDT_1D.ohlcv

# Or compile only — produces a .py file you can edit and commit
pyne compile my_strategy.pine

The CLI re-compiles only when the .pine file is newer than its generated .py, so unchanged scripts never hit the API. Set your key once via PYNESYS_API_KEY, the --api-key flag, or workdir/config/api.toml.

HTTP API

# POST a Pine Script — get readable PyneCore Python back as plain text
curl -X POST https://api.pynesys.io/compiler/compile \
  -H "Authorization: Bearer $PYNESYS_API_KEY" \
  -F "script=@my_strategy.pine"

POST /compiler/compile returns the compiled Python directly. Identical scripts are served from the server-side cache instantly and do not consume your compile quota. Full interactive reference at api.pynesys.io/docs.

Key Features

  • Personal Bearer API keys — create, rotate, or revoke any time from your dashboard
  • Smart server-side cache — re-compiling the same Pine Script returns instantly and does not bill your quota
  • Mtime-aware CLI — skips the API entirely when your .pine source hasn't changed
  • Output is human-readable PyneCore Python — read it, edit it, version-control it
  • Interactive OpenAPI reference at api.pynesys.io/docs

Compiler Pricing

The same subscription covers Pine Script compilation in PyneIDE, from the CLI and through the API.

Free Discord trial

Try the compiler with 3 free script conversions through our Discord bot. Join the server and open the #pine-compiler-bot channel to get started.

Try on Discord

🌱 Seed

$8 / month

For bringing one or two Pine indicators over to Pyne. Convert them here and keep working on the Pyne code in PyneIDE, where running and debugging it is free.

  • 5 script conversions per day
  • 1 script conversion per hour
  • Failed conversions don't count toward your limits
  • 1 API key

🌿 Sprout

$18 / month

For converting Pine scripts regularly. Each conversion gives you Pyne code that you can edit, run and debug in PyneIDE for free.

  • 30 script conversions per day
  • 5 script conversions per hour
  • Failed conversions don't count toward your limits
  • 2 API keys

🌲 Grower

$28 / month

For writing Pine Script every day in PyneIDE. The IDE recompiles your script each time you run it after an edit, so this plan allows 60 compiles an hour.

  • 700 script conversions per week
  • 60 script conversions per hour
  • Failed conversions don't count toward your limits
  • 5 API keys

🌳 Forest

$48 / month

For staying with Pine Script and using PyneIDE all day. Your scripts stay in Pine, so you get the IDE's debugger and live chart and can keep working on TradingView too.

  • 2,100 script conversions per week
  • 120 script conversions per hour
  • Failed conversions don't count toward your limits
  • 10 API keys

Plan Comparison

SeedSproutGrowerForest
Price$8$18$28$48
Pine compiles5 per day30 per day700 per week2100 per week
Pine compiles per hour1560120
API Keys12510
Max Script Size25 KB50 KB150 KB300 KB
  • Each run of a changed .pine file is one compile. Unchanged scripts come from the cache and don't count.
  • Converting a Pine v4 or v5 script to v6 doesn't use your quota.
  • The generated Pyne code is yours to read, edit and keep.

Most scripts convert 1:1 and run as-is. When one doesn't, the generated Python is readable, so a small manual edit usually gets it working. See the FAQ and the PyneCore Compatibility page for details.

Join Our Community

Connect with other traders, developers, and the PyneSys team.

Frequently Asked Questions

No. Keep charting and publishing on TradingView, and develop your scripts in PyneIDE. There they are files in your own git repository, and you can step through them bar by bar in a debugger, which TradingView doesn't have.

It automatically transforms your Pine Script code into Python-compatible "Pyne" code. This Pyne code can be run in an open-source system called PyneCore, which preserves Pine semantics but in Python form.

Classic compiler! We don't use any LLM/GPT-based generation, only deterministic transformation rules (full lexical parser → AST → transform → codegen pipeline). This ensures reliable, predictable conversion results every time.

For PyneIDE, only VS Code and the extension. PyneIDE downloads its own Python and the PyneCore runtime the first time you need them, so you don't need a system Python.

Without the IDE, you can use the compiler through the web app, the PyneCore CLI or the HTTP API. The CLI calls the API and only converts a script that isn't in the cache yet.

With the PyneCore system, it can run on any platform: Linux, macOS, Windows. The system requires Python 3.11+ and doesn't use cumbersome external dependencies.

Pine Script is TradingView's programming language. We're not copying or reverse-engineering it, but building an independent system that is functionally compatible with it. This means the same logic and behavior applies, but in Python language, with full control and customizability.

No. The compiler only converts Pine Script to Pyne code, and conversion in the other direction isn't planned for the near future.

You don't need it to backtest locally and keep the script running on TradingView. Keep the Pine Script file as your source and run it with PyneCore or PyneIDE, which compile it through the PyneSys compiler API in the background (this needs an API key from one of the plans). When you're happy with the results, publish the same file on TradingView. You only work with the Python side if you want to.

Almost always. Of the 1,000 published TradingView scripts in Pyne in the Wild, 1,000 convert as they are, and 1,353 of the 1,353 outputs that can be compared with TradingView match it: plots bar by bar, strategies trade by trade.

If a script still misbehaves, the generated Python is human-readable, and the Compatibility page shows the status of every Pine Script feature in PyneCore.

Found a bug or a missing feature? Please flag it on Discord or GitHub — that's the fastest way to get it fixed.

PyneSys currently supports Pine Script v4, v5, and v6. Pine v4 and v5 scripts are upgraded automatically by our built-in converter before being converted to Python. For scripts older than v4, PyneSys still tries to interpret and upgrade them as v4. This works well in most cases, but it is best-effort and not guaranteed. In rare edge cases, automatic upgrade may not be possible, and the script logic needs to be adjusted manually to be v6-compatible before Python conversion.

This website uses cookies and similar technologies. By continuing to use the site, you accept this. Details in our Privacy Policy.