6 Easy Steps to Run Pine Script v6 in TradingView

If you’re interested in learning how to build and test your own trading indicators or strategies, Pine Script is the tool for you.

Pine Script is the coding language used in TradingView, one of the most popular charting platforms for traders.

TradingView recently introduced Pine Script version 6, which comes with more features and improvements.

But many beginners ask this common question: “How do I run Pine Script v6 on TradingView?”
Don’t worry. In this article, we will walk you through every step in a simple way. No complicated language. Just clear, beginner-friendly instructions.

What is Pine Script?

Pine Script is a programming language created by TradingView. It is used to create custom indicators, alerts, and strategies on charts.

For example, you can make your own Moving Average, RSI indicator, or even backtest a buy-sell strategy using Pine Script.

What’s New in Pine Script v6?

Version 6 of Pine Script includes some major updates:

  • Better performance and speed
  • New built-in functions and features
  • Cleaner and more flexible syntax
  • Easier to write and read code

If you are starting fresh, it’s always good to begin with the latest version.

Step-by-Step Guide to Run Pine Script v6 on TradingView

Let’s now look at the actual steps to run Pine Script v6.

Step 1: Open TradingView

First, visit www.tradingview.com. You can use the free version or sign in with a free account.

Once you’re on the site:

  • Click on “Chart” at the top.
  • This will open the TradingView chart screen.
Step 2: Open Pine Editor

At the bottom of your chart screen, you will see a tab named “Pine Editor.”

  • Click on it to open the Pine Script editor.
  • This is where you can write and run your code.
Step 3: Write or Paste Your Pine Script Code

Now it’s time to enter your Pine Script code.

To use version 6, make sure your script starts with this line:

//@version=6

Let’s look at a very basic example:

//@version=6
indicator("Simple MA", overlay=true)
ma = ta.sma(close, 14)
plot(ma, color=color.orange, title="14-period MA")

This code will create a simple 14-period moving average.

Step 4: Add Script to Chart

Once you have written the script:

  • Click on the “Add to chart” button (above the editor window).
  • This will apply your custom indicator or strategy to the chart.

If there are no errors, the script will run smoothly, and you will see the result on your chart.

Step 5: Save Your Script

Always remember to save your work.

  • Click on the “Save” icon.
  • Give your script a name like “My First Script.”

This way, you can come back later and make changes.

Step 6: Fix Any Errors (If Any)

If your script doesn’t run and shows an error:

  • Read the error message below the editor.
  • Double-check your syntax (correct version, brackets, etc.)
  • Use the TradingView Help Center or forums for help if stuck.

Also Read – 5 Best AI Tools for Pine Script to Supercharge Your TradingView Strategies (2025)

The Bottom Line

Running Pine Script v6 in TradingView is not as hard as it sounds. Once you understand the steps, it becomes very simple.

Whether you want to create your own custom indicator or test a trading idea, Pine Script can help you a lot.

Start small. Experiment. And with time, you’ll become more confident in creating your own trading tools.

Leave a comment