From 518d471a9337aec9f692fd5534b1c23d02cd80d0 Mon Sep 17 00:00:00 2001 From: fawce Date: Mon, 17 Sep 2012 15:31:59 -0400 Subject: [PATCH] fixed slippage was ignoring order direction. --- 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 9e1decb0..363e70ad 100644 --- a/zipline/finance/slippage.py +++ b/zipline/finance/slippage.py @@ -117,7 +117,7 @@ class FixedSlippage(object): txn = create_transaction( event.sid, amount, - event.price + self.spread/2.0, + event.price + (self.spread/2.0 * direction), event.dt, direction, self.commission