Skip to main content

How to Add Pinescript Code in TradingView

Introduction ​

To make the most of TradingView, it's important to understand and use Pine Script. Pine Script allows users to create custom indicators, strategies, and scripts to tailor their trading approach.
This guide aims to simplify the process of adding Pine Script code into TradingView, with a focus on implementing AlgoTest's ready-made strategy templates.

Whether you're a beginner looking to enhance your trading skills or a seasoned trader aiming to refine strategies, this step-by-step tutorial will provide the insights needed to integrate sophisticated Pine Script code into your TradingView charts.

AlgoTest Ready Made Strategy Template​

AlgoTest is an intuitive algo-trading platform that helps you to backtest, forward test, and deploy your strategy.

AlgoTest provides ready-made Pine Script strategy templates for educational purposes to traders. These templates can be used by beginner traders to increase their learning curve in Pine Script.

How to Get Ready Made Pine Script Template in AlgoTest​

To obtain a ready-made strategy template, simply follow the steps below.

  • Visit AlgoTest.in, sign up, and create an account if you don't have one. Then, log in.

  • Go to the Signals Page in AlgoTest by clicking on the Signals button as depicted in the image below.

  • Scroll down to see a list of 20 ready-made strategy templates.

  • Select the strategy you want to add in TradingView.

  • Copy the code by clicking the copy button, as shown in the image below.

How to Add Pine Script in TradingView​

To add your Pine Script code in TradingView, follow these simple steps:

  • Go to TradingView.com, log in, and open charts by clicking on "Products" and then "SuperCharts."

  • Click on the Pine Editor button as shown in the image below.

  • Click on the "Open" button as indicated in the image below.

  • Click on the "New Indicator" button, as shown in the image below.

  • Remove everything you see in the "Pine Editor" box, as shown in the image below.

  • Paste the code copied from AlgoTest, then click the Save button and choose a random name for saving.

  • Click on the 'Add to Chart' button to add your strategy to the charts.

  • Now your strategy has been added to the chart, and you will be able to see the Long-Short signal on the chart.

  • You can also backtest your strategy script by clicking on the "Strategy Tester" button.