pine-scripts

Add a script to TradingView

Published scripts are added from TradingView itself; every other script is pasted into the Pine Editor from its source file.

Indicator pages show a TradingView link at the top when the script is published there.

  1. Open the link and add the script to your favourites.
  2. On the chart, open Indicators and pick it from Favorites.

Updates to a published script arrive through TradingView; nothing needs to be copied.

  1. Open the .pine file on GitHub and copy its full contents; the Raw view makes that easy.
  2. In TradingView, open the Pine Editor below the chart and create a new indicator, or a new strategy for files from strategies/.
  3. Replace the template code with the copied source, save, and choose Add to chart.

Note

All scripts are Pine Script v6: the first line of every file is //@version=6. Replace the editor’s template completely instead of pasting below it.

What a script file contains

Every .pine file starts with the same header: name, version, build date, a short description, the feature list and, where already added, the Data Contract. The CHANGELOG.md in the same directory lists what changed in each version.

Directories with several files

Some directories hold more than one script. The Vein suite in indicators/trend_direction/vein/ consists of several indicators that are added to the chart separately; other directories keep an older version next to the current one. The README on each indicator page explains which file is which.

Strategies

Strategy files live in strategies/ and are loaded the same way, as a new strategy in the Pine Editor. Run them on standard candles or bars only; the reason is on the Strategies page.

Continue with the Quickstart.

Edit this page on GitHub