nz
Takes a value and an alternative of the same type, and stands in for the value where it is absent. Five overloads, one per data type. The alternative is optional; what is substituted when you leave it out is not stated by the contract, so pass one where the answer matters.
nz(series bool value, series bool alt) → series boolnz(series color value, series color alt) → series colornz(series float value, series float alt) → series floatnz(series int value, series int alt) → series intnz(series string value, series string alt) → series string| Parameter | Type | Required | Description |
|---|---|---|---|
value | series bool | yes | The value to check. Required. |
alt | series bool | no | The alternative to use in its place. Optional, and of the same data type as the value. |
Returns series bool or series color or series float or series int or series string — A value of the same data type as the arguments: series bool, series color, series float, series int or series string.
indicator("Delta, zero where absent")
plot(nz(orderflow.delta, 0))See also values and types
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.