Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Backtest Calculation Speed on 1 Minute Data

I'm a new user and have tested a few example algorithms referencing 1 minute data. The example algorithms use very few calculations, such as a couple simple RSI and MAs calculations, and backtest for only a few months. The related backtest calculation speed seems to be very slow compared to other environments such as TradeStation that typically rely on a standalone workstation with a high performance processor and RAM. Is the Q system calculation speed due to shared low performance processor virtual server performance? Are there Q system options to access high performance processors, or add accelerators to speed up 1 minute data access and improve calculation speed for building and backtesting large complex algorithms? I'm considering whether to perform technical indicator calculations within the dataframe or within python code to achieve the best calculation performance given accelerator processor options.

Thanks!

5 responses

Hi Mark,

How many securities do you have in your universe (the total number of sids in data)? Also, are you running your RSI/MA calculations every simulation minute? Or are you skipping most minutes in each day?

I am not aware of ways to speed things up, other than limiting the sids to the bare minimum and not running calculations unless necessary.

You might benchmark with a simple algo that has the same sids as yours, but nothing else.

Grant

Hey Grant, I'm new to Python, so I'm not aware of all the available Python performance metrics, but I've seen much better performance as I mentioned in my original post here. My comments relate to running the example algo named 'Sample TA Lib Usage 1' that performs a simplistic RSI calculation on what appears to be 2 SIDs. When I 'built' the 1 min data based algo, it automatically performed a single iteration backtest over 13 months that took over 6 minutes to complete. I realize 1 min data is more intense data and calculation intensive than daily data, but not much is being performed in the algo data retrieval and calculations. I've noticed similar performance on other 'example' algos that make me wonder about the performance of the related Quantopian CPU performance, possible size of RAM, and effect of a shared virtual computational environment with other algos running long timed backtests. Typical Python accelerators include data set and calculation accelerators such as performing heavy calculations on GPUs.

Mark,

Not sure. Minutely backtests seem slow to me, too. The Quantopian folks may have a feel if it is Python or their code or their hardware or some combination.

Grant

As an update, I just ran the same subject algo above named 'Sample TA Lib Usage 1' this Sunday morning at about 10AM Pacific. The algo ran SIGNIFICANTLY faster, just under 30 seconds timed from pressing the 'Build Algorithm' button. The dramatic performance difference between timing the build and backtest several times at 6 minutes during trading hours last week, versus timing the build and backtest for the same algo at just under 30 seconds says to me there is a 'virtual shared server' congestion performance problem. Can Quantopian test various algo build and backtest performance during peak versus low shared server demand to identify any server performance problems? Additional server capacity or dedicated member accounts may be necessary for those who will be running large complex algos, especially during live trading...

Thanks!

Correction, I just noticed my test result just posted was run with daily price settings, my mistake. The 1 min data build and backtest still runs appallingly slow...