fikira

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

Education
COINBASE:BTCUSD   Bitcoin
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
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

LuxAlgo Dev: www.luxalgo.com
PineCoder: www.pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.