TradingView
fikira
Feb 10, 2022 10:25 PM

Explaining Pine Script keywords: 'var' and 'nz'  Education

Bitcoin / United States DollarCoinbase

Description

Life is about learning, but frequently these things seems difficult if not impossible.
When you don't know anything about a certain subject, it can be daunting, but when ​you know plenty of it, it is easy!

Coding/scripting can be very daunting, and sometimes difficult to overcome 'basic' things.

It is perfectly normal that some 'basic' stuff are very difficult to grasp in the beginning
(and the 'beginning' can take longer then you would think)

With this tutorial I want to make it a bit easier to get to know certain keywords like 'var' and 'nz'

Besides these links
var
https://www.tradingview.com/pine-script-docs/en/v5/language/Variable_declarations.html
https://www.tradingview.com/pine-script-reference/v4/#op_var

nz
https://www.tradingview.com/pine-script-reference/v4/#fun_nz
https://www.tradingview.com/pine-script-docs/en/v5/language/Type_system.html

I wanted to add a bit of extra help, making it easier to understand the concepts of 'var' and 'nz'

The following 2 scripts are best used on a Monthly Timeframe with a Ticker that exists longer then 2 years (example Bitcoin)
After you've loading the script on your chart, open the console so you can read and follow the instructions and explanation in the script.
var
https://www.tradingview.com/script/f9Yrc0LO-Explaining-VAR/
nz
https://www.tradingview.com/script/wZ0tnAs0-Explaining-nz/?utm_source=notification_email&utm_medium=email&utm_campaign=notification_comment#tc8030631

In this way I hope I can facilitate the comprehension of these keywords!

In the future I intend to make more tutorials regarding pivot points, array's, loops, ...

Cheers!

  • A: How to get to be the best?
  • B: Make no mistakes
  • A: how do I make sure I don't make mistakes?
  • B: By learning
  • A: How do I learn?
  • B: By making mistakes
Comments
tbiktag
Really useful post! Thanks for sharing!
fikira
@tbiktag, Thanks you so very much! :D
A_Traders_Edge
i feel like fixnan should be in here too, no?
fikira
@chasinalts, Yep, indeed, will do in the future, thanks!
More