How to add Pine Script in TradingView
Adding TradingView Pine Script is a short sequence. You open a chart, open the editor, paste or write the source, save it to your account, then add it to the candles. You do not need an invite list, and you do not need a paid TradingView plan. The plan only limits how many indicators you can keep on one chart at once.
This guide covers how to add Pine Script to TradingView from a .pine file, how to open the Pine Script editor in TradingView, and how to run Pine Script in TradingView so it stays on your layouts. It also covers what to check before you treat the plot as context.
Open a chart before you touch the editor
Pine Script runs on a chart, not in a separate application. Log in to TradingView in a browser, open a symbol you already watch, and stay on that chart. The editor, the save box and Add to chart all live here.
A script you save belongs to your TradingView account, not to that one ticker. You can change symbol later. If you are not logged in, Save will ask you to sign in first. Do the paste on a computer: the mobile apps can load scripts you have already saved, but the editor is built for the browser chart.
How to open the Pine Script editor in TradingView
On the desktop chart, look at the bottom edge for tabs such as Pine Editor, Strategy Tester and Replay. Click Pine Editor. A code pane opens under the candles, with a script name, a Pine version tag, and buttons for Save and Add to chart.
If those tabs are hidden, open the panel controls on the bottom edge and turn Pine Editor on. Drag the horizontal splitter up until you can see several lines of code and the error console underneath. How to open Pine Script editor in TradingView is always the same: chart first, then the bottom tab. A red console message is usually why Add to chart stays off.
Three ways a script arrives on your chart
How to add Pine Script to TradingView depends on how it is published. The plot can look similar. The ownership is not.
| How it arrives | You can read the source | If access is withdrawn |
|---|---|---|
| You paste a .pine file and save it | Yes | It stays on your account |
| You add a public library script | Only if the author left the source open | It stays until they unpublish it |
| An author invites your username | No | It disappears when they remove you |
Public library scripts are easy to find and uneven in documentation and closed-bar behaviour. Pasting your own source leaves a file you can read, copy and keep if you change TradingView plan.
ZynIQ sells the first kind: a .pine file you paste into your own account, which stays there. It is not an invite-based script (FAQ). You pay once, download the Pine v6 source and paste it yourself. There is no invite list and no TradingView username to send.
Paste a .pine file without overwriting something else
A .pine file is plain text.
- Open the file in a text editor on your computer. Select all of the text and copy it.
- In the Pine Editor, open the script menu next to the name and create a new blank indicator. Do not paste on top of a sample or a script you already use.
- Paste the copied source. The first lines should include a version tag such as
//@version=6and anindicator()orstrategy()declaration. - If the console is clean, press Save. Give the script a name you will recognise under Indicators. TradingView stores it as a private script on your account.
- Press Add to chart.
If the editor shows an error, read the first line. Typical causes are a truncated copy, an extra character at the top, or a strategy file pasted into an indicator stub. Create a new blank script, paste again, then save.
Some source files start with a comment block that holds a licence note, an email address or an order number. Leave that block in place. It does not change the plot, and it marks the copy as yours.
If Add to chart works but nothing visible appears, open the indicator settings and check pane, colours and visibility. A tool that draws in its own pane can look missing if that pane is collapsed.
How to run Pine Script in TradingView after it is saved
You do not need the editor open once the script has saved cleanly. Open Indicators, go to the Mine (or My scripts) list, and click the name. It loads on the current chart with its default inputs. Use the settings cog on the indicator’s status line to change lengths, colours, sessions and visibility. Save the layout when the mix of tools is useful. TradingView restores those indicators when you reopen the layout, including scripts you pasted yourself.
Alerts are not created by Add to chart. If the script exposes named conditions or alert() calls, press Alt+A, set the condition to that script, and choose a named event or Any alert() function call. Set the trigger to Once per bar close unless you have a clear reason not to. After you change the script’s inputs, create the alert again.
To refresh the code later, open the same saved script in the editor, paste the new source, and save. Keep the original .pine file on your computer as well, so you can re-paste it if you clear scripts or move account.
What your TradingView plan actually limits
ZynIQ indicators work on any TradingView plan, including free (indicators). You can open the editor, paste source, save, and add to a chart without paying TradingView.
The plan limits how many indicators may sit on one chart at once. If Add to chart fails with a limit message, remove another indicator from that chart or split tools across two layouts. The script remains saved on your account either way.
Market data is a separate limit. A script can only see the feed your account is allowed to see. Some futures print delayed unless you have a real-time data subscription, and plots and alerts then arrive late by the same delay.
Scripts you pasted still run if you move between TradingView plans. Invite-only access is what tends to vanish when a vendor’s list changes.
Checks before you trust the lines
Before you leave a new script running:
- Confirm the declaration.
indicator()plots and can alert.strategy()adds an order engine and a tester report. If you only wanted lines and labels, a strategy file is the wrong tool. - Watch a known swing or session on replay, or by scrolling history. See whether labels lock when the candle closes. Values that bounce on the forming bar and settle at close are still calculating.
- Read the inputs. Note whether the script wants volume, a session timezone, a higher timeframe or a minimum range.
- Turn the script off, then on, on a second symbol. Defaults sized in ATR often travel better across forex, crypto, stocks and index futures than defaults sized in fixed points.
None of this is a prompt to place a trade. Indicators are analysis tools. Trading is risky and you can lose money. Test on a range you already understand, and write down what you will ignore as well as what you will watch.
Add source you can keep
Invite-only scripts hide the code. Public scripts are mixed. If you want to add Pine Script to TradingView so you can read it, keep it and run it on a free plan, pasting source is the direct route.
That is the model at ZynIQ: one payment per indicator, the Pine v6 source as a .pine file, and the same editor steps as above. The download page opens after payment, and the link is emailed too. There is no subscription and nothing to cancel.
If you want a first script that is simple to add and simple to read on a closed candle, start with Breakout Essentials. Open the Pine Editor, paste the file, save it under a name you will recognise, and add it to one chart before you add anything else.
Questions people ask
How do I open the Pine Script editor in TradingView?
Open a chart on the desktop site, then click the Pine Editor tab on the bottom edge. If the tab is hidden, turn it on in the bottom panel controls and drag the splitter up until you can see the code and the error console.
Do I need a paid TradingView plan to add Pine Script?
No. You can paste source, save it and add it to a chart on any plan, including free. The plan only limits how many indicators may sit on one chart at once. The saved script stays on your account even if you hit that limit.
Why will TradingView not add my pasted script to the chart?
Read the first error in the editor console. Common causes are pasting on top of another script, a missing version line, a strategy file in an indicator stub, or the chart already being at your plan's indicator limit.
Can I run the same Pine Script on more than one chart?
Yes. Once it is saved under Mine (or My scripts), you can add it to any layout on your account. Keep the original .pine file as a backup so you can paste it again if you clear scripts or move account.
What is the difference between pasting source and an invite-only script?
Pasted source lives on your TradingView account and you can read it. An invite-only script is attached to your username by the author and can disappear if they remove you from their list.