quantlab.execution.rules.add#
- quantlab.execution.rules.add(a, b)[source]#
vectorbt’s
add_nb:a + b, exactly 0 when the two cancel up to tolerance.Of opposite signs (or one of them 0) they cancel when their magnitudes are
is_close; of the same sign when the sum isis_closeto 0. Written out rather than throughis_close, since it runs per order. Takes numpy scalars as well as floats, and returns a float.Examples
>>> add(0.3, -0.3 + 1e-13), add(1.0, 2.0) (0.0, 3.0)