replaceMissing
Replace na with a number (default 0).
Reference/Math & comparisons/Function
replaceMissing(series, replacement)
na is not available: the indicator does not have enough bars yet (ema(50) is na for the first 49 bars). replaceMissing fills those gaps so comparisons do not stay false forever. Shorthand: nz(series, replacement).
Parameters
| Name | Type | Description |
|---|---|---|
series | series | Input that may be na. |
replacementoptional | number default 0 | Value used when the series is na. |
Return value
series
Also accepted: nz.
Example
plot replaceMissing(rsi(14), 50) as "RSI"