General-Purpose Functions


Evaluate an expression with no possibility a of NaN result


NoNan(expr, replacement {0})


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.


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).





Copyright © 2020-2022 Systematic Solutions, LLC