SuperCharting
Sign in Get started Account Open charts

Learn / Strategies

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:

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:

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

  1. Open a chart, for example NSE:NIFTY on the 15-minute timeframe, and press Ctrl + E.
  2. The editor starts with a short template: a licence comment, //@version=6, indicator("My script") and plot(close). Replace it with your own code, such as the example below.
  3. Watch the console. When it shows the ✓ line, click Add to chart. The console confirms "Added to chart (1 plots)".
  4. 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=true and overlay=false, the script moves between the price pane and its own pane.
  5. 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:

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:

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.

Try it on a live chart

SuperCharting runs in your browser: charts, Pine-compatible scripts, the Strategy Tester, alerts and the screener, with Indian and global markets.

Create a free account More guides