Pine Script editor online — run your TradingView scripts free
Trading understands Pine Script, the TradingView scripting language. Paste your version 5 or 6 indicator or strategy into the editor as it is: the editor recognizes the language, runs the script on our candles and draws it on the chart, and tests a strategy on history. Free, with no sign-up and no TradingView account.
86% of open-source scripts work as they are: 834 of 966, checked on November 28, 2026
How to move a script from TradingView
- Copy the whole text of your script from the Pine Editor in TradingView — together with the
//@version=…line at the top. - Open Trading, press the “ƒx” button — “My indicators” — in the chart’s top bar (on a narrow screen it may sit in the “More” menu) and choose “New Pine Script indicator”. The button below opens the editor straight on a starter script.
- Replace the starter with your text. The editor tells the language by the
//@version=…line, so you can paste the script into the field of an ordinary new indicator too; the line under the code will say “Pine Script”. - Press “Apply to chart”: an indicator appears on the chart, and a strategy also in the tester under the chart. The
input.*parameters become fields under the code — you can change them without touching the text. - Type a name and press “Save”: the script appears in the “My indicators” list and in the “Indicators” dialog — you can put it on any chart.
If something is missing, the editor highlights the line and says why, for example:
//@version=6
indicator("My script")
import TradingView/ta/7 as tal
plot(tal.ao())Line 3, column 1 — import is not supported yet
//@version=4
study("My script")
plot(sma(close, 20))Line 1, column 1 — Pine Script version 4 is not supported: use version 5 or 6
How many scripts work
We check compatibility on open-source scripts: 966 indicators and strategies of versions 5 and 6 from 63 public GitHub repositories with an open license (MIT, MPL, Apache, GPL and others). The TradingView website is not queried for this.
| Scripts | Work as they are | Compile |
|---|---|---|
| All | 834 of 966 — 86% | 895 — 93% |
| Indicators | 583 of 704 — 83% | 642 — 91% |
| Strategies | 251 of 262 — 96% | 253 — 97% |
Run of November 28, 2026: “works” means the script compiles and runs without an error on five candle series of different length (400–1,400 candles): Apple stock daily and hourly, bitcoin hourly, bitcoin to euro and gold daily.
Of those that do not work, 36 import libraries published on TradingView, 39 are too heavy for one run, and the rest (57) lack some functions or fail on our data — see the list below.
What is supported
The engine has 446 built-in functions of the language and 330 variables and constants. By family:
| What | Functions | What it can do |
|---|---|---|
| Syntax | — | All the syntax of versions 5 and 6: var and varip, types and qualifiers, if, switch, for, for…in, while, your own functions and methods, type, enum, tuples [a, b] = f(), history x[n] of any expression. |
| Indicators and windows | 59 | ta.* — every function of the version 6 reference: averages, RSI, ATR, MACD, stochastic, pivots, Supertrend, VWAP, crossings. The formulas follow the original: Wilder’s smoothing, seeding with the average of the first values, na at the start of a series. |
| Output on the chart | 10 | plot, plotshape, plotchar, plotarrow, hline, fill, bgcolor, barcolor — lines, histograms, marks, levels, fills, background and candle color. |
| Parameters | 14 | input.* of every kind become fields under the code: numbers, checkboxes, lists, price source. Color, symbol and time keep the value from the script. |
| Drawing objects and tables | 105 | label.*, line.*, box.*, table.*, linefill.*, polyline.*, chart.point.* — with the language’s limits: 50 objects of one kind, up to 500 with max_labels_count, max_lines_count, max_boxes_count. |
| Other symbols and intervals | 10 | request.security and request.security_lower_tf, ticker.*, timeframe.*: daily levels on an hourly chart, an index next to a stock, a panel of several intervals. No look-ahead; barmerge.lookahead_on works as in the language. |
| Strategies | 48 | strategy() with all its parameters, entries and exits (strategy.entry, order, exit, close, cancel), targets, stops and trailing stops, pyramiding, OCA groups, risk rules, the position state and the list of trades. |
| Time and sessions | 12 | time(), time_close(), timestamp(), the calendar, session.*, str.format_time, time zones and daylight saving time. The script takes the exchange’s trading hours from the symbol info. |
| Arrays, maps, matrices | 115 | array.*, map.*, matrix.* — as functions and as methods (arr.push(x)), loops for … in. |
| Math, strings, colors | 48 | math.*, str.* with number masks and str.format, color.* with the palettes of versions 5 and 6. |
| Log and errors | 4 | log.info, log.warning, log.error — a log under the code in the editor; runtime.error stops the run with your text. |
Our own engine runs the script: the text is parsed and calculated candle by candle, as the language requires, but it is never run as code — no eval, no access to the page. A heavy loop cannot freeze the tab: a run has a budget, and past it there is a clear error.
What is missing
Never
- Import of libraries published on TradingView (
import author/library/version): their code is kept by TradingView and we do not have it. The functions you need from an open-source library can be moved straight into your script. - Protected and invite-only scripts: their text is not available to us or to you.
- Data we do not have:
request.currency_rate,request.dividends,request.earnings,request.economic,request.financial,request.footprint,request.quandl,request.seed,request.splits. A script with them gets a clear error, not an empty line. - Old versions 1–4: convert the script to version 5 or 6 in the Pine Editor and paste it again.
Not yet
- Requests on special chart types:
ticker.kagi,ticker.linebreak,ticker.pointfigure,ticker.renko. plotcandleandplotbarare calculated, but the script’s own candles are not drawn yet.- Spreads of symbols in a request (
"AAPL/MSFT") and exchange holidays in session strings. - In strategies — a recalculation after a fill inside a candle (
calc_on_order_fills), lower-interval candles (use_bar_magnifier) and currency conversion. - Pixel-exact layout of labels and tables: colors and widths follow the script, but a text may sit a few pixels away.
Strategies and fill rules
A Pine Script strategy is tested by the same tester as ours: trades on the chart, the equity curve with drawdown, the list of trades and a report — net profit, share of winning trades, profit factor, a comparison with “bought and held”. The test runs over the symbol’s history — up to the last 20,000 candles.
Fill rules — as in the language
- The script runs once per candle, at its close, and sees the position after the fills of that candle: it never looks into the future.
- A market order is filled at the open of the next candle; with
process_orders_on_close = true— at the close of the same one. - Inside a candle the price goes from the open to the nearer extreme, then to the farther one and to the close. A limit and a stop are filled at their own price, and after a gap — at the price the market reached.
- Slippage (
slippage, in ticks) worsens market and stop fills; a commission of any of the three kinds is charged on every fill. - An order lives until it is filled or cancelled; the same
idchanges it, an opposite entry reverses the position,pyramidingallows adding to it. - A size in money or in percent of equity is worked out at the close of the order’s candle; by default the oldest trade is closed first.
- There is no recalculation inside a candle: the run goes once per candle over four prices — open, high, low and close.
All the rules with examples are in the description of the mode for developers, in English →
A test on history does not promise the same result in the future: real orders are filled at other prices and at other moments. This is not investment advice.
Data and symbol names
The script runs on the same candles as the Trading chart: stocks of the US, the Moscow Exchange, Europe and other exchanges of the world, indices, currencies, commodities and crypto. For guests quotes are exchange-delayed; after logging in they are real-time where available.
The script knows its chart: syminfo.ticker, syminfo.mintick (the exchange’s price step), the time zone and trading hours (syminfo.timezone, session.*), timeframe.period — the chart’s interval.
Symbols in TradingView notation
Names like NASDAQ:AAPL in request.security and input.symbol are translated into ours automatically:
| In the script | What the script gets |
|---|---|
NASDAQ:AAPL | Apple — a stock on a US exchange |
MOEX:SBER | Sberbank — a Moscow Exchange stock |
BINANCE:BTCUSDT | bitcoin to the dollar |
FX:EURUSD | euro to the dollar |
SP:SPX | S&P 500 — by the CME future |
TVC:DXY | the dollar index |
COMEX:GC1! | gold |
AAPL | without an exchange — by the exact ticker |
Stock exchanges: NASDAQ, NYSE, AMEX, NYSEARCA, ARCA, BATS, NYSEMKT, OTC, MOEX, RUS, BME, EURONEXT, EPA, EBR, XETR, XETRA, FWB, MIL, LSE, LSIN, SIX, TSX, TSXV, ASX, NSE, BSE, BMFBOVESPA, BMV, BCS, BYMA, BCBA, BVC, TSE; plus 26 crypto exchanges and 20 currency venues. Without an exchange, the exact ticker is looked up.
To see whether we have a symbol, search for it above the Trading chart. If it is not there, the script shows the error There is no symbol …, and with ignore_invalid_symbol = true the request returns na.
Examples
Short examples of our own — copy any of them into the editor and adjust it.
Moving average cross with a fill and signals
//@version=6
indicator("EMA cross", overlay = true)
fastLen = input.int(9, "Fast", minval = 1)
slowLen = input.int(21, "Slow", minval = 1)
fast = ta.ema(close, fastLen)
slow = ta.ema(close, slowLen)
p1 = plot(fast, "Fast", color.orange)
p2 = plot(slow, "Slow", color.blue)
fill(p1, p2, fast > slow ? color.new(color.green, 85) : color.new(color.red, 85))
plotshape(ta.crossover(fast, slow), "Up", shape.triangleup, location.belowbar, color.green, size = size.small)
plotshape(ta.crossunder(fast, slow), "Down", shape.triangledown, location.abovebar, color.red, size = size.small)Yesterday’s high and low on an intraday chart
//@version=6
indicator("Yesterday's high and low", overlay = true)
[hi, lo] = request.security(syminfo.tickerid, "D", [high[1], low[1]], lookahead = barmerge.lookahead_on)
plot(hi, "High", color.green, style = plot.style_stepline)
plot(lo, "Low", color.red, style = plot.style_stepline)RSI with levels and a table of the last value
//@version=6
indicator("RSI panel")
len = input.int(14, "RSI length")
r = ta.rsi(close, len)
plot(r, "RSI", color.purple)
hline(70, "Overbought", color.gray)
hline(30, "Oversold", color.gray)
var table t = table.new(position.top_right, 2, 1, bgcolor = color.new(color.gray, 85))
if barstate.islast
t.cell(0, 0, "RSI")
t.cell(1, 0, str.tostring(r, "#.0"), text_color = r > 70 ? color.red : r < 30 ? color.green : color.gray)Strategy: channel breakout with a stop
//@version=6
strategy("Channel breakout", overlay = true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type = strategy.commission.percent, commission_value = 0.1)
len = input.int(20, "Channel")
upper = ta.highest(close, len)[1]
lower = ta.lowest(close, len)[1]
plot(upper, "Upper", color.green)
plot(lower, "Lower", color.red)
if close > upper
strategy.entry("Long", strategy.long)
if close < lower
strategy.close("Long")
strategy.exit("Stop", "Long", stop = strategy.position_avg_price * 0.95)Alerts, sharing and saving
Alerts
An alert is set with the bell in the indicator’s legend — on its line, on an alertcondition() (its text takes {{close}}, {{ticker}}, {{plot_0}} and other placeholders), on all of its alert() calls at once with their frequencies and on the order fills of a strategy (alert_message). The data of other symbols from request.security the server loads itself. The server checks it even when the page is closed; up to 5 alerts on your own scripts, you need to be logged in.
Share
The “Share” button gives a link to the chart: the texts of the scripts on it go along — up to 120,000 bytes for all of them. The recipient sees the indicator and can save it for themselves.
Saving
Without logging in, scripts are kept in the browser; after logging in, in your account too, and they open on any device. Up to 50 scripts; a Pine Script script — up to 262,144 characters and 256 KB, all texts together — up to 4 MB.
Limits
| Characters in a script | 262,144 |
|---|---|
| input() parameters | 500 |
| Outputs of plot(), plotshape() and the like | 64 |
| hline() levels and fill() areas | 64 |
| Your own functions and methods | 500 |
| Iterations of one loop | 100,000 |
| Elements of an array or a matrix | 100,000 |
| Depth of x[n] history | 5,000 |
| Candles in one calculation | 100,000 |
A script that goes past a limit gets an error with its place in the text instead of freezing the page.
FAQ
What is Pine Script?
The TradingView scripting language: it is used to write your own indicators and trading strategies for a chart. Trading has a compatible implementation of it — scripts of versions 5 and 6 work without changes.
Is this the official Pine Script from TradingView?
No. It is an independent compatible implementation of the language: the parser and the calculation are written by us from scratch, and the project is not affiliated with TradingView. TradingView and Pine Script are trademarks of their owner; BotHub FiRe is not a partner of TradingView.
Do I need to pay or sign up?
No. The editor, the charts and the strategy tester are free and work without logging in — scripts are kept in the browser. Logging in is needed only to open them on other devices.
Can I run Pine Script without TradingView?
Yes. Paste the script into the Trading editor — it runs on our charts of stocks, currencies, commodities and crypto, no TradingView account needed.
Will my scripts work the same as on TradingView?
The formulas of the built-in functions follow the original: Wilder’s smoothing in RSI and ATR, EMA seeded with the average of the first values, na at the start of a series. But the numbers may differ slightly: we have our own quote sources and our own history length, and averages with a long memory depend on the first candle of the series. Strategies are filled by the rules of the language; the tester’s report is our own.
Which versions of Pine Script are supported?
Versions 5 and 6, by the //@version= line at the top; a script without it is read as version 6. The editor does not take versions 1–4 — convert the script to version 5 or 6 in the Pine Editor.
Do libraries and import work?
No: libraries published on TradingView are kept by them, and we do not have their code. If a library is open source, copy the functions you need into your script and call them without the library’s name.
Can I move a protected script?
No. The text of protected and invite-only scripts is hidden; only open source code can be moved.
Do you have my symbol?
Type it into the search above the Trading chart. TradingView names — NASDAQ:AAPL, MOEX:SBER, BINANCE:BTCUSDT — are translated into ours automatically; if the symbol is missing, the script shows an error.
Can I set an alert on a Pine Script script?
Yes: the bell in the indicator’s legend — on its line, on an alertcondition(), on all of its alert() calls at once or on the order fills of a strategy. The server checks it even when the page is closed; you need to be logged in.
- The second language of Trading — simple formulas: how to write your own indicator →
- Trading compared with TradingView paid plans →
- Fire Charts — our open-source chart library →
- The compatible mode described for developers — on GitHub, in English →
Open the Pine Script editor Open Trading
TradingView and Pine Script are trademarks of their owner. BotHub FiRe is an independent project and is not a partner of TradingView. Not investment advice.