A Pine Script compiler that runs in your browser
Paste an indicator or strategy, press Compile, and PineOps parses it, checks it against the rules of its Pine Script version, runs it bar by bar and draws the result. Errors come back with line numbers and, where a function was renamed between versions, the exact replacement.
Everything executes locally on your device. There is no account, no queue and no server round-trip, which is why results appear in milliseconds.
What the engine supports
| Area | Supported |
|---|---|
| Versions | v4, v5, v6 — version-specific errors with migration hints, and a one-click v4 → v5 → v6 converter |
| Language | series and history operator [], var/varip, tuples, user functions, if/for/for…in/while/switch, user-defined types, methods, enums, arrays and maps |
| Built-ins | 50+ ta.* functions (SMA, EMA, RMA, WMA, HMA, VWMA, RSI, MACD, BB, ATR, Stochastic, CCI, MFI, DMI/ADX, Supertrend, SAR, pivots…), math.*, str.*, color.*, array.*, map.*, input.* |
| Output | plot, plotshape, plotchar, plotarrow, hline, bgcolor, barcolor, labels, alertcondition, log.* |
| Strategies | strategy.entry, order, close, close_all, exit (stop/limit/profit/loss), commission, net profit, win rate, profit factor and drawdown |
| Not yet | library imports, matrix.*, real multi-symbol request.* data, lines/boxes/tables rendering, fill() rendering |
Starter template
//@version=6
indicator("My script", overlay = true)
length = input.int(20, "Length")
plot(ta.sma(close, length), "SMA", color = color.teal)
More tools
- Pine v6The current Pine version, with v6 rules enforced.
- Pine v5Namespaces, switch, while loops, types and methods.
- Pine v4Legacy study() scripts still run here — and convert in one click.
- v4 → v5 converterPaste v4 code, press → v5 or → v6, then Compile to verify.
- Strategy testerstrategy.entry / exit / close on sample or CSV data.
- PythonPython 3 via WebAssembly — runs on your device.
- Python + stdininput() reads from the stdin box — one value per line.
- Python data sandboxNumPy and pandas, loaded on demand, running locally.
- JavaScriptSandboxed Web Worker with top-level await.
- TypeScriptTranspiled by the real TypeScript compiler, then executed.
- LuaLua 5.3 on the Fengari VM.
- SQL (SQLite)A real SQLite engine in WebAssembly — fresh database every run.
- HTML / CSS / JSLive preview in a sandboxed frame.
- JSON → YAMLValidates, then converts. Runs locally.
- YAML → JSONCatches indentation errors, outputs formatted JSON.
- JSON formatterPretty-print and validate in one step.
- Markdown → HTMLRendered preview plus the HTML source.
Frequently asked questions
Is this the official TradingView compiler?
No. PineOps is an independent Pine Script engine written from scratch that runs in your browser. It checks syntax and version rules, executes your script bar by bar and plots the result. It covers a large subset of the language; anything it does not support yet is reported as a clear error rather than silently ignored.
Which Pine Script versions are supported?
Version 4, version 5 and version 6 (the current release). The engine reads the //@version= line and applies that version's rules — for example study() and sma() in v4, indicator() and ta.sma() in v5, and the stricter boolean rules of v6.
What market data does the script run on?
By default, 600 daily bars of built-in sample data that is identical on every run, so results are reproducible. You can also load your own OHLCV data from a CSV file — it is read locally and never uploaded.
Will my results match TradingView exactly?
Indicator math (moving averages, RSI, MACD, Bollinger Bands, ATR and so on) follows the published formulas, but the data is different and the strategy tester is a simplified emulator. Use PineOps to catch errors, learn the language and prototype quickly, then confirm on TradingView before trading.
Is my code sent to a server?
No. Compilation and execution happen entirely in your browser. Share links store the code in the URL fragment, which browsers do not send to servers.