Regarding slippage

Regarding slippage

1. This is a formula that tries to replicate pretty realist the slippage for a trade.

0.05 + 0.2 / (AvgDailyTot(10) / 1000000 ^ .7) + 1 / Price

Some example:

Price\MegaVol 0.125 0.25 0.5 1 2 4
0.125 8.08% 8.06% 8.06% 8.05% 8.05% 8.05%
0.25 4.08% 4.06% 4.06% 4.05% 4.05% 4.05%
0.5 2.08% 2.06% 2.06% 2.05% 2.05% 2.05%
1 1.08% 1.06% 1.06% 1.05% 1.05% 1.05%
2 0.58% 0.56% 0.56% 0.55% 0.55% 0.55%
4 0.33% 0.31% 0.31% 0.30% 0.30% 0.30%
8 0.20% 0.19% 0.18% 0.18% 0.18% 0.18%
16 0.14% 0.13% 0.12% 0.12% 0.11% 0.11%
32 0.11% 0.09% 0.09% 0.08% 0.08% 0.08%
64 0.09% 0.08% 0.07% 0.07% 0.07% 0.07%
128 0.08% 0.07% 0.06% 0.06% 0.06% 0.06%
256 0.08% 0.07% 0.06% 0.06% 0.06% 0.05%
512 0.08% 0.06% 0.06% 0.06% 0.05% 0.05%
1024 0.08% 0.06% 0.06% 0.05% 0.05% 0.05%

1. Slippage for ETFs should not be computed like the one for stocks. ETFs have special ways of being created by demand by the provider and should be around 0.05%-0.15% according to with price and volume.
8 responses

Dan,

Slippage for ETFs should not be computed like the one for stocks. ETFs have special ways of being created by demand by the provider and should be around 0.05%-0.15% according to with price and volume.

You are absolutely correct.

What is AvgDailyTot in yours formula?

It is interesting to know your opinion about volume impact in Quantopian default slippage model.

AverageVolume for last 10 days. I've created a formula that somehow represents the slippage that portfolio123 uses and is kinda OK for what happens after thousand of transactions that I made in last 10 years.

It is interesting to know your opinion about volume impact in Quantopian default slippage model.

At least for ETFs, Quantopian's method is too restrictive, IMHO. Regarding stocks, I usually simulate with that formula in my initial post and is ok for medium size folios.

Anyway is a very nice platform!

I agree with you
Quantopian is a very nice platform.
But it will be much better if using more realistic default slippage model .

you are right. I was a bit surprised that positions that are trivial to open in a couple of minutes in reality w/o much slippage on EDV for example, don't complete in 2 days on Q simulations. Isn't too realistic.

So you're thinking something like this:

# Custom slippage model for ETFs
class ETFSlippage(slippage.SlippageModel):
def process_order(self, data, order):
# The last day of the history is today, which will skew the average
# So get 11 days of history and throw out the last one
volume = data.history(order.sid, fields="volume", bar_count=11, frequency='1d')[:-1].sum()
current_price = data.current(order.sid, 'price')
slip_amount = 0.05 + 0.2 / (volume / 1000000 ** 0.7) + 1.0 / current_price
new_price = current_price + (slip_amount * order.direction)

return new_price, order.amount


very probable but not for ETFs for normal stocks. ETFs should have around 0.1% constant slippage or bounded in 0.05%, 0.15% because they have other mechanisms of creation on demand.

So for EDV for example, in reality, you can trade it hundreds of time easier than what you can simulate with default settings on Q.

I'm not sure about that sum() should be average on last 10 bars or even minimum to make it more conservative.

Is someone official plans to answer to this issue? I try to write a SectorRotation for the contest and I have problems because the classic Sector ETFs are not liquid enough to trade $3.000.000 a day when they trade around 15.000.000 shares x$50 a day or over 200 times more than I want to do.