June 22, 2025

How to test an idea on 150 million ticks in half a minute

We will test the crypto on Bitmex, since there you can easily get ticks with directions for free.
Actually, the idea is very simple:
— buy if the sum of the volumes of the last 5 trades is more than 500,000
– sell if the sum of the volumes of the last 5 trades is less than -500,000
We trade one conditional bitcoin (ticker XBTUSD).
We'll use R and the QuantTools package.
Let's write a little bit of code:
How to test an idea on 150 million ticks in half a minute

Results:
How to test an idea on 150 million ticks in half a minute

How to test an idea on 150 million ticks in half a minute

Everything was calculated in about 38 seconds. Of these, 30 seconds were spent reading ticks from the disk. Below is a time profiling table in milliseconds:
How to test an idea on 150 million ticks in half a minute