Complete Suite: all 12 tools. 6 Premium desks inside.All 12 tools $606.98 one by one

$606.98 one by one $299 once Save $307.98Get the SuiteGet it
ProEA Lab · MT5, TradingView and trading research · Evidence standards

How to Open a .pine File (and Get It onto TradingView)

See its code, what can cost you money, and the fix.

or

  • Free check
  • No sign-up
  • Read in your browser

It catches what costs traders money

  • Signals that vanish
  • Repainting
  • Backtests that see the future
  • Missing alerts
· 5 min readUpdated
Links to TradingView in this article are partner links: if you open a new TradingView account through one and buy a plan, TradingView may pay ProEA a commission, at no cost to you.
A .pine file is plain text: Pine Script source code with a .pine name. Open it with any text editor (Notepad, TextEdit, VS Code), or with the opener above, which reads it in your browser. For an indicator or strategy, copy the code, paste it over a new script in the Pine Editor, save, and click Add to chart. You never upload the file itself.

The opener above reads UTF-8 .pine and .txt files or pasted code, up to 512 KiB, in your browser. It checks the script there too: yours sits on the left, each line a check fails on marked with why; the fixed script sits on the right, each changed line marked with what changed. The free fix (curly quotes, stray ``` lines, Pine v5 to v6) is yours to copy. The Pro fix (higher-timeframe values that don't repaint, signals that wait for the bar to close, an alert for each signal) is shown locked, with one of its changes free to see, and unlocks for one payment. Reading, checking and copying happen in your browser; saving, compiling and adding to a chart happen in TradingView.

What is a .pine file? Extension, format and type

.pine is the file extension for Pine Script source code, the language TradingView's indicators and strategies are written in. The format is plain text, usually UTF-8, so there's no file type to convert. TradingView keeps your scripts in your account. A .pine file is a copy of that code someone saved as text to share or sell.

A Pine script needs one declaration. Its version annotation is optional: without it Pine assumes version 1. The annotation can appear anywhere in the script; TradingView recommends putting it at the top. See TradingView's script structure page, rechecked 2026-10-15:

LineWhat it saysIf it's missing
//@version=6The Pine version, 1 to 6Pine assumes version 1
indicator(...), strategy(...) or library(...)What the script is, and its titleIt isn't a whole script

The Add to chart steps on this page apply to indicators and strategies. If the reader identifies a library(), it supplies functions for another script to import; it does not run as a chart indicator. Ask its author for the published import and a calling-script example. See TradingView's library instructions.

The opener performs limited text checks. It identifies a version annotation, a recognizable declaration and a few lines the compiler is known to refuse, such as curly quotes, study() in a v5 or v6 script, or transp in a v6 plot(); each has an error page with the message TradingView prints. It doesn't prove the script compiles: use Pine Editor for that, and our Pine Script repaint & v6 checker to scan for lookahead leaks and old v4/v5 calls.

A v5 file still runs. To upgrade it, the Pine Editor's Manage script → Convert code to v6 works when the v5 code compiles (migration guide, checked 2026-10-08).

The three ways a paste fails

  1. Fence lines. Code copied from a chat or a web page often arrives wrapped in ``` lines. They aren't Pine; delete them. A stray backtick or a curly quote left behind stops the compiler with no viable alternative at character.
  2. Missing declaration. A complete script needs one declaration. If this reader can't identify it, check the source in Pine Editor: unrecognized syntax doesn't by itself prove you copied a fragment.
  3. Pasted next to the template. A new script opens with example code. Select all of it, then paste, so only your code remains.

Use itOpen the file in a text editor first and look for its version annotation and declaration.

Watch outDouble-clicking a .pine file may offer you no app at all; that doesn't mean it's broken.

How do I upload a .pine file to TradingView?

You don't upload it: TradingView takes the code by paste. Open the file, copy all of it (the opener's Copy for TradingView button does that), then:

  1. Open the Pine Editor on a TradingView chart. If you can't see it, here's where the Pine Editor is on each device.
  2. Start a new script, select all of its template and paste your code over it.
  3. Save, then select Add to chart.

The full click path, with the Pine Editor's current position, is in how to add Pine Script to TradingView. If the chart refuses the script, you may be at your plan's indicator limit.

On the TradingView app (iPhone, iPad or Android)

Paste and save the script once on a computer, then use it on your phone. A saved script belongs to your TradingView account, not to one device, so look for it in the app's indicator list. We couldn't find an official way to paste code inside the iOS or Android app; the phone section of our install guide covers the mobile-browser route TradingView documents.

Pine file viewer, reader or text: other ways to open it

Any app that opens plain text opens a .pine file. Your computer just doesn't know the ending, so it may not offer one.

  • Online: the opener at the top of this page is a free .pine file viewer and reader. It reads the file in your browser and uploads nothing.
  • Windows: right-click the file, choose Open with, then Notepad. If Notepad isn't listed, choose another app and pick it there.
  • Mac: Control-click the file, choose Open With, then TextEdit. If TextEdit isn't offered, choose Other…, set Enable to All Applications and select TextEdit.
  • Phone: the opener above runs in a phone's browser too. If the file picker won't offer a .pine file, rename it to .txt or use Paste source text.

To turn a .pine file into text, rename its ending to .txt, or open it above and use Save as .txt. Nothing inside changes: it was text all along.

Chapter 1 is this page: what is in a .pine file, opening it on any computer, and the five steps to a chart. The other twelve cover the Pine Editor, 69 compile messages with their fixes, v5 to v6 and a cheat sheet to print.

The deep version, as a PDF

Pine Script v6 for Traders, the Cheat Sheet and Fix-It Manual

Open and add any script, find the Pine Editor, fix every common compile error, move v5 to v6, and change a script yourself, with the cheat sheet on one page.

  • Open a .pine file on any device, find the Pine Editor, and get the script onto your chart
  • 69 compiler messages traders search for, each exactly as TradingView's compiler printed it, with the fix that compiled
  • v5 to v6 (and v4): seven changes that stop the compile and six that compile and change results
See what's inside →

One payment, instant download. Refund within 7 days if you haven't downloaded it.

For script sellers: an install kit for your buyers

If you sell or share .pine files, send the paste steps with the file. Everything here is free to use, with no signup and no permission needed. Your buyer's file is read on their own device and never uploaded.

The short link points to this page; if the page ever moves, the link moves with it. Put INSTALL.txt next to the .pine file in your zip, or paste it into a Gumroad page or a delivery email; the README suits GitHub. The embed runs this same opener on your page, its links open in a new tab, and the credit line under the frame is plain HTML you can keep, edit or delete. Change any of the wording as you like.

Not a file to upload: text to paste.

Frequently asked questions

What is a .pine file?

A plain-text file holding Pine Script source code, TradingView's scripting language. The .pine extension is a naming convention: the format is plain text, usually UTF-8, so any editor reads it and renaming it .txt changes nothing inside.

How do I open a .pine file?

With any text editor: Notepad, TextEdit, VS Code. Or open it in the opener on this page, which reads it in your browser. If your computer asks which app to use, pick a text editor.

How do I open a .pine file on a Mac?

Control-click the file, choose Open With, then TextEdit. If TextEdit isn't offered, choose Other…, set Enable to All Applications and select TextEdit. Or open it in the opener on this page, which reads it in your browser.

Is there a .pine file viewer online?

Yes: the opener on this page is a free .pine file viewer and reader. It reads the file in your browser, shows its Pine version, script type, title and full code, and uploads nothing.

How do I upload a .pine file to TradingView?

For an indicator or strategy, you don't upload the file; you paste its code. Open the Pine Editor, start a new script, select all of its template, paste the code over it, save, then click Add to chart. A library supplies functions for another script to import; ask its author for the published import and a calling-script example.

Can I add a .pine file on the TradingView app?

Paste and save the script once on a computer. A saved script belongs to your TradingView account, not to one device, so look for it in the app's indicator list. We couldn't find an official way to paste code inside the iOS or Android app.

Why won't my .pine file compile in TradingView?

Compile it in Pine Editor to get the actual error. Remove Markdown fence lines and replace the editor template rather than appending to it. This opener reads a version annotation and a recognizable declaration, and flags a few lines the compiler is known to refuse; it does not compile the code or prove there is exactly one declaration.

What does //@version=6 mean at the top of the file?

The Pine version the script is written for. The annotation is optional: without it Pine assumes version 1. It can appear anywhere in the script, though TradingView recommends putting it at the top. A v5 script still runs; the Pine Editor's Manage script → Convert code to v6 upgrades it if it compiles.

Continue reading

Which TradingView Plan Do You Need? Pick by the Features You Use

TradingView has five plans, from free Basic to Ultimate, and they differ in limits more than in tools: indicators per chart, charts per tab, alerts, how far Bar Replay goes, seconds and tick charts, webhooks, Deep Backtesting, the Pine Screener, AI prompts. Tick what you'd use and read the cheapest plan that does it all, row by row from TradingView's pricing page re-read on 2026-11-26.

Oct 29 · ProEA Lab

Explainer cover titled Which TradingView plan do you need, under the kicker TradingView, Plans. A schematic: four needs on cards, 3 indicators on a chart, webhook alerts, seconds charts and Deep Backtesting, each with the plan it starts at, above five plan cards from Basic to Ultimate, Basic, Essential and Plus crossed out and Premium lit. Steps underneath: add your needs, each crosses out the plans without it, the cheapest left is the answer.

How to Export TradingView Chart Data to CSV (and Which Plans Can)

The arrow next to Save opens Download chart data…, which saves the chart's symbol and indicators to a CSV, with the time in UTC. The free plan can't: signed out, Download asked us to upgrade, and the pricing table starts it at Plus.

Oct 23 · ProEA Lab

TradingView Keyboard Shortcuts: The Full List, Searchable

Ctrl+/ on the chart opens TradingView's own list of shortcuts. Here are all 172 from that dialog, searchable, with the Mac keys and the dozen worth learning first: Alt+A for an alert, / for indicators, Alt+T for a trendline.

Oct 23 · ProEA Lab