Eightcap Logos_WEB.svg

Unlocking custom indicators and strategies with Pine Script for TradingView

15 April 2025

If you’re looking to fine-tune your technical analysis or backtest your trading strategies, Pine Script makes customising your charts more seamless. Our unique partnership with TradingView enables traders to access game-changing tools that can assist you in  developing and testing your strategies.

Of course, as the UK’s only TradingView exclusive broker, Eightcap will support you every step of the way. In this guide, we’ll dive into how to use Pine Script for TradingView, starting from writing your very first script all the way to implementing more advanced trading strategies.

So, what exactly is Pine Script? How do you add Pine Script in TradingView? How can you get the most out of TradingView’s Pine Script integration? Let’s get into it!

So, what is Pine Script for TradingView?

Pine Script in TradingView is a handy scripting language specifically developed to help you create custom technical indicators, strategies, and alerts in TradingView. It’s a way to customise the TradingView charting platform..

Whether you’re looking to build indicators that align with your trading goals, backtest your strategies, or automate those repetitive tasks, Pine Script is a great tool – it offers an intuitive way to customise TradingView’s powerful charting tools.

Our 5 essential tips on how to use Pine Script in TradingView

Using the TradingView Pine Script editor really gives traders some extra tools to support their trading strategies. With Pine Script in TradingView, you can do a whole lot, including:

  • Create custom indicators: You can develop indicators that align with your specific trading strategies. 
  • Automate trading signals: Set up alerts based on certain market conditions, so you never miss a beat. 
  • Backtest strategies: Evaluate how a particular trading strategy would have performed in the past, giving you valuable insights for the future. 
  • Combine multiple indicators: By viewing several indicators together, you can consider additional factors in your analysis and decision-making process. 

It’s all about giving you the tools you need to get more out of your trading experience.

Here’s how you can add Pine Script to TradingView

Getting started is simple. Here’s how you can jump right in:

  • Open the TradingView Pine Script editor: In TradingView, just click on the ‘Pine Editor’ tab at the bottom of your screen. This is where you can write and edit your custom scripts. 
  • Create or modify a script: With Pine Script, you can either build indicators from scratch or tweak existing ones.
  • Apply the script to your chart: Once you’ve got your script ready, click ‘Add to Chart’ to test it out. Your strategy or indicator will then pop up on your TradingView chart!

By following these steps, you can start customising your trading experience today!

How to combine two indicators in TradingView pine script

Using two or even multiple indicators is a great way for traders to refine their analysis even further. With the Pine Script TradingView tools, you can easily merge different technical indicators into one clear view. This not only makes your charts easier to read but also reduces clutter, giving you clear signals to base your trades on.

A perfect example of this would be combining a moving average with a momentum indicator for trend confirmation. By using multiple indicators, traders can potentially refine their understanding of the market. So, why not get the most out of these powerful tools?

TradingView backtest in Pine Script – test your strategies!

Have you ever wondered about the value of backtesting in trading? It’s such a handy way to check how a strategy would have performed historically before you dive into live trades. Basically, you take your strategy and run it against historical data. This lets you test out different parameters, assess risks, and really fine-tune everything before you actually place any trades.*

*Note: backtesting is no guarantee of future performance, so please remember that risks are still involved.

If you’re using TradingView, their Strategy Tester tool helps with this process. You can look at all sorts of performance metrics like how often you’re trading, and even profit and loss. 

Here’s a quick rundown of how to set up a TradingView backtest in Pine Script:

  1. First, you’ll need to define your trading rules right in Pine Script.
  2. Next, apply that script to some historical market data.
  3. Then, it’s time to check out the performance using the Strategy Tester.
  4. Finally, you can adjust your parameters for optimisation.

Trade your way with Eightcap and TradingView Pine Script

TradingView Pine Script is a great tool that supports your charting features. With it, you can create custom indicators, automate your trading signals, and even backtest your strategies. When you pair TradingView’s powerful scripting abilities with Eightcap’s smooth execution, you can create a trading environment.

Check out some of the best perks of this integration:

  • Trade directly from TradingView charts: You can execute trades straight from your charts without having to jump between platforms. Super convenient, right? 
  • Access to 800+ CFDs (600 in the UK): Whether you’re into forex, indices or commodities you’ve got plenty of options to trade.
  • Lightning-fast execution: Enjoy ultra-low latency order execution that helps reduce slippage — because we all know how important speed is in trading. 
  • Customisable charting tools: You can tweak your charting tools using Pine Script, making them optimised for your technical analysis.

Join us at Eightcap today. Create an account here — we’ll be with you each step of the way.

Company information

Eightcap Global Limited, regulated by The Securities Commission of The Bahamas (SCB) (SIA-F220) at registered address 201 Church Street, Sandyport, Nassau, Bahamas.

Eightcap International Ltd (registration number 8427413-1) is regulated by the Seychelles Financial Services Authority (FSA SD100) at registered address Office 12, 3rd Floor, IMAD Complex, Ile Du Port, Mahe, Seychelles.

Eightcap International Trading (registration number 227050) is regulated by the Mauritian Financial Services Commission (GB25204603) with registered address Silicon Avenue, 40 Cybercity, The Cyberati Lounge, Ground Floor, The Catalyst, Ebene, Mauritius.

Important Risk Warning

Risk Warning: Margin trading involves a high level of risk, and may not be suitable for all investors. You should carefully consider your objectives, financial situation, needs and level of experience before entering into any margined transactions with Eightcap, and seek independent advice if necessary. Forex and CFDs are highly leveraged products which mean both gains and losses are magnified. You should only trade in these products if you fully understand the risks involved and can afford losses without adversely affecting your lifestyle (including the risk of losing the entirety of your initial investment). You must assess and consider them carefully before making any decision about using our products or services.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. The majority of retail investor accounts lose money when trading CFDs. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

The information on this website is general in nature and doesn't take into account your personal objectives, financial circumstances, or needs. It is not targeted at the general public of any specific country and is not intended for distribution to residents in any jurisdiction where that distribution would be unlawful or contravene regulatory requirements. Eightcap International Ltd makes reasonable efforts to provide accurate translations of the website in other languages for your convenience. Where content is missing, inaccurate or incomplete, the English version prevails.

@Eightcap 2026