Bulltrading
WebsiteLaunch AppYoutube(FR)Youtube(EN)
  • πŸ“˜Preface
  • Bulltrading Designer
    • βš’οΈDesigner
    • πŸ’»Editor
      • My indicators
      • MarketPlace
      • Create your first indicator
    • πŸ“ˆMy strategies
      • Publish
        • Personal Strategy
        • Strategy To Rent
    • πŸ‘¨β€πŸ’»Pinescript
      • First indicator
      • Pine Scriptβ„’ v5 User Manual
        • Pine Scriptβ„’ Execution Model
        • Time Series
        • Pine Script Structure
        • Identifiers
        • Operators
        • Variable declarations
        • Conditional structures
        • Loops
        • Type system
        • Built-ins
        • User-Defined Functions
      • Built-ins
        • Variables
          • Candles
          • Colors
          • Math
          • Ta
        • Functions
          • Indicator
          • Input
          • Plot
          • Na - Nz
          • Math
          • Ta
      • Bulltrading vs TradingView
  • Bulltrading tokens (BLT)
    • πŸͺ™BLT Tokenomics
    • 🧾BLT Contract
    • 🏦Hold Program
    • πŸ”’BLT Audit
    • 🎯[EN] How to buy BLT ?
    • 🎯[FR] Acheter du BLT
  • Other
    • ⁉️Frequently Asked Question
    • πŸ“ΊVideo Tutorials
    • πŸ“’Glossary
  • πŸ“Ί[FR] Youtube
  • πŸ“Ί[EN] Youtube
  • 🦊Twitter
  • 🦊Discord
  • 🦊Telegram
Powered by GitBook
On this page
  • nz
  • na
  1. Bulltrading Designer
  2. Pinescript
  3. Built-ins
  4. Functions

Na - Nz

nz

Definition: Replaces NaN values with zeros (or given value) in a series.

Syntax:

nz(source, replacement) β†’ simple int/float/color/bool
nz(source, replacement) β†’ series int/float/color/bool
nz(source) β†’ simple int/float/color/bool
nz(source) β†’ series int/float/color/bool

Returns:

The value of `source` if it is not `na`. If the value of `source` is `na`, returns zero, or the `replacement` argument when one is used.

Arguments:

Name
Type
Description

source

series int/float/bool/color

Series of values to process.

replacement

series int/float/bool/color

Value that will replace all 'na' values in the source series.

Example:

//@version=5
indicator("nz", overlay=true)
plot(nz(ta.sma(close, 100)))

na

Definition: Tests if x is na.

Syntax:

na(x) β†’ simple bool
na(x) β†’ series bool

Returns:

Returns true if `x` is na, false otherwise.

Arguments:

Name
Type
Description

x

series int/float/bool/string

Value to be tested.

Example:

//@version=5
indicator("na")
// Use the `na()` function to test for `na`.
plot(na(close[1]) ? close : close[1])
// ALTERNATIVE
// `nz()` also tests `close[1]` for `na`. It returns `close[1]` if it is not `na`, and `close` if it is.
plot(nz(close[1], close))
PreviousPlotNextMath

Last updated 1 year ago

πŸ‘¨β€πŸ’»