ProEA Lab · MT5, TradingView and trading research · Evidence standards
Indicators

How to Add Pine Script to TradingView (.pine File Guide)

Open a .pine file, paste its code into TradingView, save and add it to your chart. Find the Pine Editor and fix common import and compile errors.

PL · 4 min readUpdated
A brass pneumatic-tube capsule holding a rolled paper script being slotted into a receiver panel beside a dark candlestick chart — poster titled Two Routes In.

To add Pine Script to TradingView, open the Pine Editor, create a new script, replace its template with your code, save, then select Add to chart. If you downloaded a .pine file, open it in a plain-text editor and copy the code first. For an existing community indicator, search its name in the Indicators dialog instead.

Somewhere on your machine sits a .pine file. Maybe you bought it, maybe an AI wrote it, maybe a friend exported theirs. The steps below take that source code onto your chart; you do not need to publish it or make it public.

Where is the Pine Editor in TradingView now?

Start with the Pine icon on the chart's right toolbar. TradingView's current help describes a floating editor that you can dock to the right, detach into another window, or place below the chart with Move to bottom. The launch icon and the editor's position are different things. TradingView: Pine Editor layout and controls.

If the Pine Editor is not showing at the bottom, look for that right-toolbar icon first. A tutorial screenshot may use a different editor layout; the paste, save and add-to-chart workflow stays the same.

Hand-drawn sketch of the TradingView layout: candlestick chart in the center, a narrow tool rail down the right edge with the Pine icon circled in orange, and the editor panel sliding out beside it.
The Pine icon opens the editor. This sketch shows the right-side layout; floating and bottom layouts are also available.

How do I open a .pine file?

A .pine source file contains plain text. Open it with Notepad, VS Code, or another text editor, then copy the complete script. Paste the code itself into TradingView, including its //@version line. Copying the filename, dragging the file onto a chart, or pasting a Markdown code fence does not replace this step.

How do I add a script I have as source code?

Paste it over the editor's template, then add it to the chart. The whole route:

  1. Open the Pine Editor from the right rail.
  2. Click the script-name dropdown in the editor's header and create a new indicator. The editor fills in a small template.
  3. Select all in the editor and paste your script over the entire template — not underneath it, not inside it. All of it.
  4. Choose Save script from the script-name menu and give it a name.
  5. Select Add to chart in the editor. If compilation succeeds, the script appears on your chart. You can reopen your saved code from My scripts in the Indicators dialog.

This follows TradingView's documented create, replace, save and add workflow.

Step 3 is where most installs die, and we know because we've worked the support ticket: a compile error complaining about two declarations. That's what happens when a script gets pasted after the template instead of over it — the file ends up with two indicator() declarations, and the compiler refuses both. Select all, paste, gone.

The other classic: a script written for an old Pine version. The first line of any script declares its version (ours declare //@version=6); a years-old snippet from a forum may need migration before it compiles. The editor's error console tells you plainly — read it before assuming the script is broken.

Hand-drawn sketch of the Pine Editor panel header: script name with dropdown chevron on the left, then the Add to chart and Save script icons circled in orange, a Publish script pill, and an ellipsis menu at the far right.
Look for Save script in the script-name menu and Add to chart in the editor. This is an illustrative sketch; control placement can vary.

How do I add a community indicator instead?

If you don't have source code and just want an existing tool: Indicators in the top toolbar opens the dialog TradingView calls Indicators, metrics, and strategies. Type what you want in the search box, click a result, and it's on your chart — that's the entire flow.

The left rail of that dialog is the map worth knowing: My scripts (everything you saved from the editor), Purchased, the built-in sets (Technicals, Fundamentals), and the Community shelves — Editors' picks, Top, Trending. Community scripts run from shared code you didn't write; some publish their source openly, some are closed. Which kind you're running matters the day a signal surprises you.

Hand-drawn sketch of the Indicators dialog: search field on top, left rail listing My scripts, Purchased, Technicals, Fundamentals and Community shelves, and a results column of blank script rows with one row highlighted in orange.
One dialog, two worlds: your saved scripts on the left rail, the community catalog beside it.

Which route should you actually want?

Where we're biased, priced honestly: our Pine v6 tools ship as .pine source files you add with the steps above — paste, save, add to chart — with an AI extension kit so you can make a model explain any line before you trust it. If you want to practice the route with zero spend first, VP Lite is free and full-source; same file type, same two minutes, nothing to buy.

The honest caveat either way: adding a script is plumbing. It changes what your chart shows, not whether the idea underneath has an edge — auditing that is its own two minutes, and it's the better use of your skepticism.

Paste over the template, save, add to chart — then check what the script actually does.

Continue reading

How to Tell If a TradingView Indicator Repaints (a 20-Minute Audit)

Compare live markers, reloaded history and alert receipts. Learn the difference between developing values, delayed pivots and future leakage, including the valid use of offset higher-timeframe data. A twenty-minute check can reveal discrepancies; it cannot certify every indicator.

Jul 24 · ProEA Lab

A dark chart where a glowing arrow marker is being physically peeled off the canvas by a gloved hand, leaving a faint ghost outline one candle to the left — poster titled The Arrow That Moved.

We Built a Signal Tool. Then We Tested the Grade.

An options buyer asked for fewer, stronger calls. We built a graded signal desk, ran it with costs on, and let a model learn which factors paid. The plain count beat every clever gate. Here is the whole ledger, including what failed.

Sep 4 · ProEA Lab

Ink sketch on ivory paper: a pullback to a rising average and a strong close back above it with an orange BUY B label, five factor dots with four filled, and the question whether the letter ranked anything; the statement reads: we graded the signals, then we tested the grade.

The Hit Rate Was Thirty Percent. The Exit Was the Problem.

A commenter wanted three scripts folded into one that says what is missing before a signal fires. We built it, saw a thirty-percent hit rate on the dashboard, and measured why: the textbook exit was closing trades early. Every number, on three charts, including the one where nothing paid.

Sep 4 · ProEA Lab

Ink sketch on ivory paper: a stochastic line crossing up through its band while price rides above a rising average, a checklist of four ticks beside it, and the statement: thirty percent won, the exit was the problem.