New

11 tools. $557.98 if bought one by one. 5 new Premium desks inside.$557.98 one by one

$97 once$97See all 11See it
ProEA Lab · MT5, TradingView and trading research · Evidence standards
Indicators

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

A .pine file is plain text: Pine Script source code with a .pine name. Any text editor opens it, and TradingView takes it by copy and paste into the Pine Editor. Open yours below for limited version, declaration and paste checks; compile it in Pine Editor.

PL · 3 min readUpdated
Explainer cover titled How to open a .pine file: it's plain text. A file card named session-range.pine opened into its reading: Pine version v6, type indicator, title Session range (example), 15 lines, a warning that Markdown fence lines were removed, and the five-step route into TradingView from Open the file to Add to chart.
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 below, which reads it in your browser. To get it onto TradingView, 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.
Open a .pine file here.It's read in your browser, never uploaded. See the version, declaration and literal title, check common paste issues, and copy the code.
or drop it here · showing session-range.pine
Pine version
v6
Type
indicator
Title
Session range (example)
Lines
15

It had Markdown ``` fence lines, copied from a chat or a web page. They're removed below; paste only the code.

//@version=6
indicator("Session range (example)", overlay = true)
// Shades the high-low range of a fixed session.
sess = input.session("0800-1000", "Session")
inSess = not na(time(timeframe.period, sess))
var float hi = na
var float lo = na
if inSess and not inSess[1]
    hi := high
    lo := low
else if inSess
    hi := math.max(hi, high)
    lo := math.min(lo, low)
plot(inSess ? hi : na, "High", color.teal, style = plot.style_linebr)
… 1 more lines
  1. 1. Open the file
  2. 2. Copy the code
  3. 3. Pine Editor → new script
  4. 4. Paste over the template, Save
  5. 5. Add to chart

The example file is ours, written for this page. The reader checks the version line and the declaration; it doesn't compile the code. That's the Pine Editor's job.

What's inside

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 opener performs limited text checks. It can identify a version annotation and a recognizable declaration, but it doesn't prove there is exactly one declaration or that the script compiles. Use Pine Editor for compiler errors.

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.
  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.

Then onto the chart

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

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 ending is a naming convention; the content is ordinary text you can read in any editor.

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 upload a .pine file to TradingView?

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.

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 only reads a version annotation and a recognizable declaration and warns about a few paste issues; 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

Pine Script to MQL5: Converting a TradingView Strategy to an MT5 EA

How to turn a TradingView indicator or strategy into an MT5 indicator or EA: where Pine and MQL5 run differently, which calls map to which, the time-zone trap, a worked port of one rule from our Opening Range Desk, and how to check the port bar by bar.

Oct 8 · ProEA Lab

Explainer cover titled Pine Script to MQL5: same rule, two clocks. Two stacked 5-minute charts of the same simulated candles. On the top pane, TradingView Pine in New York time, an orange box marks the 09:30–09:45 opening range and a Short signal follows two closes below it. On the bottom pane, MT5 in server time with a fixed offset of minus 7 hours in a week the server is 6 hours ahead, the box lands an hour late on the 10:30 candles and the signal is Long.

TradingView Alert Not Triggering? Five Causes, One at a Time

Most TradingView alerts that 'don't work' are doing what their settings say: firing once and stopping, waiting for the bar to close, running the old version of your script, or expired. How to tell which, and the fix for each.

Oct 8 · ProEA Lab

Explainer cover titled TradingView alert not triggering: check the frequency. Two simulated 5-minute candles against a dashed level at 2,400.00: the first pokes above and closes back below, the second closes above, with bells marking where Once per bar fires, inside both bars, and an alert log listing the two firings.

How Many Indicators Can You Add on TradingView? Every Plan

TradingView caps indicators per chart by plan: 2 on Basic, 5 on Essential, 10 on Plus, 25 on Premium and 50 on Ultimate, read from its pricing page on 2026-10-08. What the cap counts, and the one way past it that doesn't cost a plan: put several indicators in one Pine script.

Oct 8 · ProEA Lab

Explainer cover titled TradingView indicator limit: 2, 5, 10, 25 or 50. A sketch chart above a row of five indicator slots on the Essential plan: the first slot holds one Pine script with three indicators in it, then MACD, VWAP and Bollinger Bands, and one slot left free.