Documentation Index
Fetch the complete documentation index at: https://docs.darvas.app/llms.txt
Use this file to discover all available pages before exploring further.
The missing-value problem
OHLCV accessors returnnull when data is unavailable (e.g. before the lookback window is filled). Technical indicator functions also return NaN during their warmup period. Both values need to be handled before use in downstream math.
Function reference
Zero-argument form: returns
true if no value has been set yet in the current context. Rarely used directly.One-argument form: returns
true if x is null or NaN. Use this to guard before arithmetic.Returns
fallback (default 0) if x is null or NaN; otherwise returns x.Two modes of na
Why NaN propagates
JavaScriptNaN is infectious - any arithmetic involving NaN produces NaN:
NaN + 1 === NaN. If you pass a NaN into your calculation chain, every downstream result will also be NaN. Use na(x) or nz(x) to break the chain early.Practical patterns
NaN coordinates render nothing
For drawing entities, assigningNaN or null to any coordinate (x1, y1, etc.) causes the entity to render as invisible. No error is raised - it simply disappears silently.
Related pages
Bar context
OHLCV accessors that return null during warmup.
Series
Series.get() during warmup also returns NaN.
Gotchas
Silent NaN propagation and invisible entities.