signΒΆ
Defined in fynance.signal
- sign(pred)[source]
Long/short by the sign of the prediction (
+1/-1/0).Examples
>>> import numpy as np >>> sign(np.array([0.3, -0.1, 0.0])) array([ 1., -1., 0.])
Defined in fynance.signal
Long/short by the sign of the prediction (+1 / -1 / 0).
Examples
>>> import numpy as np
>>> sign(np.array([0.3, -0.1, 0.0]))
array([ 1., -1., 0.])