Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
is slippage a silly idea?

superficially, it makes sense, you buy something you drive the price up, you sell something, you drive it down. Consequently, you need to add and subtract the your impact on the market. However, since we are using historical data, our impact was also not recorded, that is, the historical price too does not have any recording or signature of our play. In which case, why should we subtract the slippage from a historical dataset that contains NOT the up tick in price that we would have introduced had we been trading live?

11 responses

ps. i'm not saying the reaping profits has no impact, it's just that the current slippage parameter seems a bit harsh.

The default slippage model is quite harsh. You are free to change the slippage model to match your observed price impact, or write your own...

I understand this, but i'm more interested in uncovering a more realistic model. again, when selling, we are subtracting profits from a historical price that was never driven up by our initial buying.

From the studies I recall, most price impact is temporary, not permanent, which is why VWAP and other execution algorithms can reduce price impact (at the expense of immediacy).

fair enough.

I can tell you some of my experience - real world slippage varies a lot based on the type of algorithm as well as the size of the position being executed - and obviously the liquidity of the security being traded.

When backtesting, I could not figure out why my model was not profitable. After hours of scratching my head, I finally turned off slippage and BOOM - instant profitability. With the slippage model active, almost every trade I made lost money.

I suspected that the Q slippage model was not real at all and decided to go live with my algo. My suspicions were correct. For my algo, the Q slippage model doesn't apply at all.

I should note that I am only trading 6 figures. Once I start trading larger amounts I expect to start experience minor slippage, but I trade very liquid securities so I don't think it will be a big problem. Also, I converted many of my algo trades to limit orders to get around slippage when trading live.

Mohammad, thank you for the informative reply.

as someone who is interested in modeling, I really want to think of the smallest possible upper-bound estimate for slippage. Right now, i'm still using quantopian's model, .1*(shares/volume)**2, and i'm allowing my algo to buy equities that have a factor of .002 or less. On a $5k transaction, that slippage still eats $10.

It'd be an interesting exercise to see if one could derive an empirical slippage model from Quantopian/Interactive Brokers trade data. I'm not sure if one can get all of the relevant data into the Q research platform. Has anyone tried this?

@toan - Having slippage means that you actually move the market (or at least saturate supply) - this is really not possible with $5k (even with low volume securities). If your trades are this small, you would probably be more accurate to turn off slippage than try to calculate it.

@Grant - The problem with empirical data is that it would have too many variables, and would therefore be pretty useless on a general level.
You would need data per trade size, per security, per minute.

For example, most of my trades are at the beginning of the day, or near the end of the day. At these times there is greater volume and therefore less slippage. Q's slippage models don't account for any of this.

To make things even more complicated.... I believe market makers would step to actually REDUCE your slippage once you place large enough trades to create arbitrage opportunities for them.

For example, I trade UVXY which is a volatility ETN. Im pretty sure that I would never get huge slippage if I just spaced out my trades by a few seconds each (or just used limit orders), because this is a derivative tied to other indexes and slippage would create arbitrage opportunities for market makers. In this scenario HFT would be working in my favor :) Of course this is all hypothetical, but I'm quietly confident in it.

My understanding is the default slippage and commissions model is intentionally harsh as a screen for the contest/fund.

It doesn't make sense to pay an extra 0.625% for limit orders, but then again, it will be hard to model scenarios where a limit order is partially filled in the real world. I guess the current model is just the "least bad" solution that's universally fair.

High turnover algos get the short end of the stick with the current model.

Kayden, I think you're right. Unfortunately what is happening as you mentioned is that more active traders are being penalized in the contest. And the irony is that Q is really a platform for active traders.