TradingView Tutorials

The Quant Nomad has over 6 years’ experience in the quantitative trading industry (15+ years in programming).
He has helped more than 200 traders and companies create/optimize their algorithmic trading models.
How to fix “syntax error at input ‘end of line without line continuation’.” in pine script
No Comments

Simple code like this won’t work for you: If you’ll add it to the chart you’ll see the following error: Syntax error at input ‘end of line without line continuation’. So what is the reason and how to fix it? It is happening because of the line wrapping rules you have in PineScript. The piece How to fix “syntax error at input ‘end of line without line continuation’.” in pine script Read More →

How to fix it? ‘the script must have one study() or strategy() function call’
No Comments

Sometimes when adding a script to the chart in TradingView you might see the following error: “Add to Chart operation failed, reason: The script must have one study() or strategy() function call”. This is happening because PineScript expects to see 1 study or strategy call in your script. Most likely you missed it when copied How to fix it? ‘the script must have one study() or strategy() function call’ Read More →

How to fix ‘expression’ argument of security function should have no side effects
No Comments

In this article, I will show you how to fix the “‘expression’ argument of security function should have no side effects” error in PineScript. Here is an example of the script that triggers that error: Error message: The issue is that when you call a function inside a “security” function you can’t plot trend line How to fix ‘expression’ argument of security function should have no side effects Read More →

Arrays in PineScript. Finally! Example of usage.
6 Comments

TradingView just recently announced the support of arrays in PineScript. And it’s a pretty big deal. Many developers waited for that for years. I want to explain to you by example how easier life will be in PineScript with arrays. Previously, if you need any arrays functionality, you had to “simulate” the arrays manually on Arrays in PineScript. Finally! Example of usage. Read More →

How to insert backtesting range to PineScript strategies?
No Comments

Quite often you want to test your Strategy on a specific date range. Unfortunately, there is no way to change this range with standard TradingView features. But you can easily adjust your strategy to include custom parameters for the backtesting range. To do that you need to complete 3 pretty simple steps. 1. Add the How to insert backtesting range to PineScript strategies? Read More →

How to fix “cannot use a mutable variable as an argument of the security function” error
No Comments

Here is an example of pivot points calculation in PineScript: This works fine in PineScript: But If you’ll try to compute the same pivots on Higher Time Frame with security function, daily in this case: That won’t work and you will see the following error in console: ” line 12: Cannot use a mutable variable How to fix “cannot use a mutable variable as an argument of the security function” error Read More →