Skip to content

Slippage

When a market order is placed, the price that you receive is dependent on the other side of the transaction (either buyers or sellers), the difference between the price you transact at the the fill-price is called Slippage.

Slippage can be modelled directly through looking through order books. Though this is out of scope for Dejavu currently. Instead, Dejavu provides a few simple slippage models out the box. But, like everything in Dejavu, you can extend and create the perfect slippage model for your backtest.

dejavu.execution.orders.NoSlippage

Bases: SlippageModel

Simple slippage that assumes no slippage occurs. In other words, the market price is the fill price.

dejavu.execution.orders.VolumeWeightedSlippage

Bases: SlippageModel

Volume-weighted slippage model.

Parameters:

Name Type Description Default
SlippageModel _type_

description

required

__init__(impact_factor=0.1)

summary

Parameters:

Name Type Description Default
impact_factor float

The impact factor for the slippage calculation. Defaults to 0.1.

0.1