Pine Script editor online: write, check and run scripts in the browser
SuperCharting's Script Editor is an online Pine Script editor: it checks code as you type, shows errors with line numbers and adds scripts to the chart.
SuperCharting has a built-in Script Editor for Pine-compatible scripts that opens beside your chart in the browser. It checks the code a moment after you stop typing, points to the line of any error, saves your scripts to your account and puts the result on the active chart with one click. Pine Script is TradingView's language; SuperCharting runs scripts written in the same version 6 syntax.
What the Script Editor is
The editor docks on the right of the chart, under the tab strip, like a side panel. You can drag the thin handle on its left edge to make it wider or narrower, and the width is remembered. It has three parts:
- The header. The top row shows "Script Editor" with collapse, maximise and close buttons. The second row shows the script name (click it for your saved scripts), the Add to chart button (it becomes an update button once the script is on the chart), the blue Save button, Publish script and the More menu (three dots).
- The code area. Line numbers, syntax colours, indent guides and small colour swatches next to colour values. Tab and Shift + Tab indent and outdent, and Enter keeps the indentation of the line above.
- The console and status bar. The console sits under the code and opens on its own when something is wrong. The status bar shows the cursor position ("Line 12, Col 5"); click it to jump to a line, or type "line:column". It also shows the script's language version, for example "Script v6".
Open the editor with the Script Editor button in the right-hand bar, or press Ctrl + E. On a phone the page opens on the chart, not the editor, but you can still open it from the same button.
How the compile check and error messages work
About 600 milliseconds after you stop typing, the editor sends the code to be compiled. The console then shows one of two lines:
- ✓ My script (indicator) or ✓ EMA Cross Strategy (strategy) when the script compiles. The title comes from your
indicator()orstrategy()line. - ✗ line 6: unexpected 'EOF' (or a similar message) when it does not. A red dot appears on the console button and the console opens, so you see the line number straight away.
The check finds syntax mistakes: a missing bracket, a bad indent, a stray word. Some mistakes only show when the script actually runs on chart bars, such as a misspelt function name. Those appear in the console after Add to chart as a line that starts with "Runtime:", again with the line number, for example Runtime: line 3, bar 0: unknown function ta.foo(). Fix the line and press the update button.
How to write and run a script in SuperCharting
- Open a chart, for example NSE:NIFTY on the 15-minute timeframe, and press Ctrl + E.
- The editor starts with a short template: a licence comment,
//@version=6,indicator("My script")andplot(close). Replace it with your own code, such as the example below. - Watch the console. When it shows the ✓ line, click Add to chart. The console confirms "Added to chart (1 plots)".
- Edit the code and click the update button (or More > Update on chart). The console says "Updated on chart". Your input values are kept. If you switch between
overlay=trueandoverlay=false, the script moves between the price pane and its own pane. - Press Ctrl + S or click Save. The first save asks for a name in the Save script dialog.
//@version=6
indicator("My first indicator", overlay=true)
plot(ta.sma(close, 20), "SMA 20", color=color.blue)
This draws a 20-bar simple moving average on the price pane. To build it up step by step, follow write your first indicator.
Saving, opening and managing scripts
Scripts are saved to your account, not to the browser, so they are there on any computer where you sign in. A few details:
- Open a saved script: click the script name in the header. A list of your saved scripts drops down.
- More menu: Add to chart, Update on chart, New blank indicator, Open file… (load a
.pineor.txtfile from your computer), Save as… and Delete script…. Deleting removes the saved copy and leaves the text in the editor. - Unsaved work: the current text is also kept in this browser, so a page reload does not lose it. That copy stays on this device only; use Save to keep the script in your account.
- Limits: up to 500 saved scripts per account and 200,000 characters per script. A name keeps letters, numbers and spaces; characters that are not allowed in file names become "_".
- From the chart: right-click a script's name in the chart legend and choose Source code… to load that script's code into the editor. Your saved scripts also appear in the Indicators dialog under My scripts.
Publishing from the editor
Publish script opens a two-step dialog. First you give a description (at least 20 characters) and choose between Publish new script and Update existing script. Then, under Final touches, you choose Public or Private, and a visibility: Open (code visible), Protected (code hidden) or Invite-only. The script must compile and its title must be something other than "My script". The full flow is in the community scripts library guide, and sharing with chosen people is in invite-only scripts.
What the editor does not do
Be clear on the limits before you rely on it:
- It checks one script at a time; there is no side-by-side diff or version history. Keep copies with Save as… if you want versions.
- A script that compiles can still be wrong. Compiling only means the code is valid, not that the logic matches your idea. Look at the plot, and for strategies read the Strategy Tester report.
- Not every Pine feature behaves exactly as on TradingView. Check the console after adding a script and compare the plot against values you know. The Pine v6 basics page lists examples that run here.
SuperCharting is currently free to use, and the editor, saving and publishing are part of every account.
Frequently asked questions
Is this the same as TradingView's Pine Editor?
No. It is SuperCharting's own editor for Pine-compatible scripts, with a similar layout. TradingView is a trademark of TradingView, Inc.; SuperCharting is not affiliated with it.
Why does my script compile but show nothing?
Look at the console after Add to chart. A "Runtime:" line with a line number means the script stopped while running on the bars. If there is no error, check that you call plot() or another drawing function, and that overlay puts it on the pane you expect.
Where are my scripts stored?
In your SuperCharting account. The unsaved text in the editor is also kept in your browser so a reload does not lose it.
Can I paste code from another site?
Yes. Paste it into the editor or use More > Open file…. Respect the licence of code you did not write, and check the console for anything this engine does not run.