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.
This commit is contained in:
Eddie Hebert
2013-06-13 12:35:58 -04:00
parent 88b9881145
commit 0ae41f4d01
+9 -10
View File
@@ -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