How do you emulate slippage in a backtest?

of course below works only on high liquid stocks or futures.
i use this, and my sim is near the real ones:

for limit orders, take out 1 tick as a slippage. (assuming your sim trade for a buy was the lowest tick!)

for stop / market orders:
1. if you're strategy enters when market is calm, then your slippage = spread.
2. if you enter the market when its volatile, slippage = spread * 2

good luck.
 
Quote from jcl:

Which slippage formula do you use?

.001 per share. This comes out to a dime per hundred shares traded. I've found that real fills are never this bad (stocks), but the effect is so negligible on the back test results that I never tweaked it further. Commissions are 10x higher.
 
Maybe another way is to randomize a 1-5 second delayed fill, resulting in a possible change in current b/a spread. At least that is what i see over at my terminals at times.
 
Quote from WinstonTJ:

Even then you can't assume that an execution would have been yours - it's always best to go a penny up/down from your target price. If you are trying to sell 1000 shares offered at $10.61 assume you get a fill when you see more than 1000 shares print at $10.62. That extra penny may be too pessimistic for some strategies...

This is an engineer's idea of professional trading.

If you are paying "slippage" = paying bid-ask spread...
Then you are increasing your commission by 200% to 400% and up...
And are totally screwed in the long run.

Instead of paying $0.003/share... it's really $0.008 or $0.013 or whatever...
Thank you kindly for donating to the NYSE Member Yacht Fund.

You MUST manage the spread well enough...
That your "slippage" is positive = capturing part of the spread...
And you are being paid for providing real liquidity.

Anyone who doesn't instinctively get this...
And can't be bothered to finesse the spread...
Is not competing... they are just donating for a while.
 
Back
Top