From 0ae41f4d01c5634bceb860cfbbfe8e6ab07a0775 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Thu, 13 Jun 2013 12:35:58 -0400 Subject: [PATCH] MAINT: Remove check in slippage model which is always true. Since `cur_amount` before it's changed by the direction, is always a positive value, multiplying it back by the direction should also always be positive. --- zipline/finance/slippage.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/zipline/finance/slippage.py b/zipline/finance/slippage.py index 2ea8f31b..01fe8995 100644 --- a/zipline/finance/slippage.py +++ b/zipline/finance/slippage.py @@ -186,17 +186,16 @@ class VolumeShareSlippage(SlippageModel): simulated_impact = (volume_share) ** 2 \ * self.price_impact * order.direction * event.price - if order.direction * cur_amount > 0: - txn = create_transaction( - event, - order, - # In the future, we may want to change the next line - # for limit pricing - event.price + simulated_impact, - cur_amount - ) + txn = create_transaction( + event, + order, + # In the future, we may want to change the next line + # for limit pricing + event.price + simulated_impact, + cur_amount + ) - txns.append(txn) + txns.append(txn) return txns