Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Fill price of Q backtest vs IB paper trading vs Reality

I have an algorithm that makes one round trip per day that I would like to take live but I'm having trouble reconciling the performance over the last two months paper trading on my Interactive Brokers account vs the same time period in a backtest. Since the beginning of November the paper trading simulation has returned 13% and the backtest over the exact same time frame with the same code has returned 32%, quite a difference. The backtest assumes $.005/share $1 minimum commissions, leverage on both is under 1.0, long only. I've looked through the trades and they match between the two simulations within a minute or so and the number of shares always match, the only difference I really see is the fill price of the orders never matches. Obviously both are a simulation, I'm just hoping for feedback from people who have taken an algo live and what their experience was with respect to backtest vs paper trading vs live fill prices.

4 responses

I implemented a vix daytrader algorithm which when deployed live also had results that varied from the backtester and even the contest results. I highly recommend calculating the realized P&L (accounting for commission and slippage) of every trade and then graphing the total P&L in your recorded variables rather than rely on the backtester return. Make sure to match the starting capital with your actual starting capital.

I wonder also if there's any comparison between backtesting with minute and tick data. Indeed fill prices and even getting in and out of positions can vary significantly at certain periods of time.

Have you seen this? How Accurate is Our Slippage Model: Comparing Real and Simulated Transaction Costs

Also, if you are trading low volume securities, have you seen this "bug"?

Thanks for the replies. This particular strategy trades fairly liquid securities, currently the 20 day sma of volume is over 30 million. I had not seen that article on slippage yet, it did provide some insight. I think the main source of the discrepancy is the fact that these securities move quickly so there could be a significant price difference in the minute between order and simulated fill. At this point I think I'll edit my algorithm to send limit orders rather than market orders as well as record/graph prices at the limit price thereby underestimating fill price and ultimately returns.