From 27761f9dec34d98d4c53f4d2c2d9866e2e2efcde Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Tue, 12 Mar 2013 19:47:01 -0400 Subject: [PATCH] MAINT: Uses copysign to extract order direction in FixedSlippage. Uses copysign instead of division by fabs. --- zipline/finance/slippage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/finance/slippage.py b/zipline/finance/slippage.py index 0b91e1cb..04ddd639 100644 --- a/zipline/finance/slippage.py +++ b/zipline/finance/slippage.py @@ -176,7 +176,7 @@ class FixedSlippage(object): if np.allclose(amount, 0): return - direction = amount / math.fabs(amount) + direction = math.copysign(1, amount) txn = create_transaction( event.sid,