mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 15:25:33 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user