Bring an indicator or a strategy from TradingView. Paste a Pine Script® v5 or v6 indicator() or strategy() script into the script editor and it is translated into a TypeScript script when it loads, with any problems reported against your Pine line numbers. Show as TypeScript in the editor shows what it became, to read or keep editing.
Pine Script is a registered trademark of TradingView, Inc.
How Pine maps to a script
request.security reads what the other timeframe had closed, which is Pine’s behaviour with lookahead off; the public API has no way to look ahead.
Strategies
A pasted strategy runs as a strategy here: an equity curve beside buy-and-hold, its fills on the chart and the Strategy report. Its orders keep Pine’s rules. An entry the other way reverses the position. One the same way adds only while the entries are under pyramiding. An entry’s size is its qty in coins, or the declaration’s default: coins, USD or a percent of equity.
Fills follow TradingView’s strategy tester. A market order placed on a bar’s close fills at the next open. A stop or limit fills where price first reaches it inside a bar: from the open to the nearer of the high and low, then the other, then the close.
Costs are not the script’s. It pays the market’s own fees (a maker fee for limit fills), the order book’s slippage and funding, so commission_value and slippage are left out with a note. The result is what the trades would have cost here, and it will not match TradingView’s number when the script assumed no costs.
Not yet supported, each refused with a message on its line: trailing stops (trail_points, trail_offset, trail_price), partial exits (qty_percent under 100), oca_name groups, stop-limit orders (limit and stop together), per-trade reads past the first open trade (strategy.closedtrades.*), and strategy.risk.* other than allow_entry_in.
A plot option the chart cannot draw, such as a format on one plot or fillgaps, is named in a PN2020 note when the script loads rather than left out without a word.
What it refuses
Each with a message saying what to do:
- Pine v4 and older: TradingView’s Pine Editor converts a script to a newer version.
import of libraries.
- Data only TradingView has:
request.financial, request.economic, request.earnings, request.dividends, request.splits, request.seed and request.quandl, and macro tickers such as TVC:DXY.
Diagnostics from the translation start with PN: PN1xxx parsing, PN2xxx types and meaning, PN3xxx not supported.
Credits
The numeric rules of the ta library (seeds, the order of operations, na handling) follow TradingView’s built-ins as PyneCore records them. Powered by PyneSys (pynesys.io).
Choose the script language
Use this guide for Pine v5 and v6 indicator and strategy workflows. The Terminal’s native scripting guide uses its own indicator, bars and plotting interface, and those native examples are not Pine source. Keep the language label beside every code block.
Paste a Pine v5 or v6 script and choose Add to chart. To extend it in the native editor, choose Show as TypeScript. For a native chart-bar EMA, open Your first script.
To import an existing indicator, check every imported function against the translation table above. Start with a chart-bar-only indicator. Add venue-specific data only when the function’s source and venue are confirmed. A script that uses Hyperliquid wallet or flow data does not establish the same inputs on Lighter.
Next step
See the limits every script runs within. Last modified on November 3, 2026