quantlab.execution.rules.is_close#
- quantlab.execution.rules.is_close(a, b)[source]#
vectorbt’s
is_close_nb: equal up to its relative and absolute tolerance.One of the vectorbt numeric rules this module owns; the backtest metrics that rebuild vectorbt’s accounting use it too, so fills and metrics cannot drift.
Examples
>>> is_close(1.0, 1.0 + 1e-12), is_close(1.0, 1.001), is_close(float("nan"), 0.0) (True, False, False)