QuantRocket logo

Disclaimer

Slippage Research

Given the trading strategy's sensitivity to slippage, it is a good idea to research typical EUR.USD spreads at the time of day we intend to trade. To do this, we will collect a month's worth of 1-minute bid/ask data from IBKR. We use the BID_ASK bar type, which provides the time-average bid and ask for the bar's duration. (Alternatively, we could collect the BID and ASK separately, see the usage guide for available bar types.)

Data collection

First, create a database for the historical data:

Then collect the data:

Monitor flightlog for the completion message:

quantrocket.history: INFO [fiber-quotes-1min] Collecting history from IBKR for 1 securities in fiber-quotes-1min
quantrocket.history: INFO [fiber-quotes-1min] Saved 27270 total records for 1 total securities to quantrocket.v2.history.fiber-quotes-1min.sqlite

Spread analysis

Now we can load the bid/ask data and check the spreads.

For this bar type, the "Open" contains the time-average bid and the "Close" contains the time-average ask.

Compute the spreads in basis points:

Get the average spread by time:

Finally, check the spreads at the time of days we intend to trade:

The average spread is about 0.15 basis points. Since the prices used in our backtest reflect the midpoint, we only expect to pay half the spread, or 0.075 basis points. Thus, our slippage estimate of 0.1 basis point seems reasonable.


Next Up

Part 7: Manual Trading