Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Would Anyone Like To Share Performance Stats On Minutely Algos?

I would find it very interesting if we could share some run time stats on minutely algos. These can be fairly high-level. I'll start:

No. Of SIDs = 100
Backtest Duration = 5 Years 8 months
Run Time = 249 minutes
Run Time Per SID Per Year = (249 / (100 * (68/12))) * 60 = 26.36 seconds
Computations (optional): Collect end of day close for each SID and use TA-Lib functions on the daily data to look for entries on the minutely timeframe.

P.

[After using Windows since around 1986 I've only found today that you can paste '(249 / (100 * (68/12))) * 60' or whatever into the Windows calculator. When did that start? 1985?]

7 responses

It's an interesting question and it's one that I track pretty closely ;) In practice, what your algorithm actually does matters as much as duration and SIDs.

In the last 24 hours, the average backtest duration was 294 seconds ;)

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hello Dan,

Your point is a good one. But your 294 seconds was daily, minutely or both? What was the average number of SIDs? What was the average backtest duration?

I'm curious about comparing like for like. If someone had a 100 SID 5-year minutely algo completing in 30 minutres maybe I could talk to them about optimising mine‽

P.

Hello Peter,

To profile sections of your code, you can use:

import time

t = time.time()  
# code goes here  
elapsed = (time.time() - t)/1e-3  # milliseconds  

Grant

Hi Dan,

I agree with Peter that minutely backtests run pretty slowly--that darn factor of 390! Seems that your typical daily backtest better execute in the blink of an eye, for a minutely one to seem zippy. Any idea what's slowing things down?

I've attached a backtest for you to profile, if you want. Any way to speed it up?

Grant

Hi Dan,

Does the Quantopian backtester load all of the data needed for a given backtest into working memory, prior to the start of the backtest? Or does it stream the data from disk?

Also, at some point, I gathered that the built-in transforms (e.g. mavg) are considerably faster than the batch transform? Is this still the case? If so, why?

I recognize that some details may be proprietary, but it would be interesting to have some insight into what goes on under the hood.

Based on number-crunching with (unoptimized) MATLAB on similarly sized data sets, it seems that the Quantopian backtester is relatively slow...is this a correct assessment? You may have trouble rolling it into a research/discovery tool, as you have on your product roadmap (I think).

Grant

Hello Grant,

These are the stats on your algo FWIW:

No. Of SIDs = 2
Backtest Duration = 1 Years 8 months
Run Time = 11 minutes 42 seconds
Run Time Per SID Per Year = ((11 + 42/60) / (2 * (20/12))) * 60 = 210.6 seconds
Computations (optional):

I think 'Run Time Per SID Per Year' is quite an interesting metric. But then I would! If Quantopian included this on the 'Backtest Details' page we could start to optimise our algos....

P.

I think if you're optimizing for runtime, you're probably optimizing for the wrong thing. Figure out how to make an algo that makes money. If you can do that, then finding optimization help will be trivial!

That said, when you have an interesting algo that is running too slowly, let us know. We plan on investing more in performance, and it's always good to get guidance on where our real-life bottlenecks are.