Category
General-Purpose Functions
Description
Evaluate an expression with no possibility a of NaN result
Syntax
NoNan(expr, replacement {0})
Parameters
expr - any formula
replacement {0} - any formula
Return Value
The result of the expression if it can be calculated, or replacement if it would result in NaN.
Notes
The default (when only one argument) is to replace NaN with 0. You can optionally specify a different replacement value as needed.
It is not usually necessary to use NoNan in any of the strategy element formulas. The backtest engine already equates "can't be evaluated" (NaN) with "false" or 0 in those formulas. The only exception is EntrySkip, for which "can't be evaluated" means "true" (do skip the entry).
|