Hi Michael. First off, thanks for the feedback. We know the backtester performance needs to be improved. We don't think the backtester will ever be "fast enough." We're going to be working on it until the day we retire ;) One of the good parts of this process is that everytime we make the backtester faster, we're making live trading faster too.
I think of the backtest as being super fast on a very specific use case, and then there are a number of factors that can slow us down. Any one of them can be a problem, and some of them compound each other. Here are things that can slow you down:
- Lots of orders! That's what killed the performance of this algo - it made 367791 orders, and keeping track of all of them incurred a pretty good performance hit.
- Minute mode v. daily mode. This one is just simple math. 390 minutes in a trading day means it is 2.6X slower. We actually are a bit faster than that because of some improvements we did already, but still, it's a big hit.
- Lots of stocks! Again, this one is mostly simple math. That's why set_universe has a limit, and your algo has a limit on how many stocks it can add manually.
- Moving averages, batch transforms. Take whatever data structure you have - and then multiply it by how many date frames you need, and we get slow. The new history() work we've kicked off will take a big load off of this problem.
- Longer tests. Simple math again - a 10-year test is 10X a 1-year test. We have no plans to fold space or time yet ;) but maybe we'll get there.
Anytime you have a slow test, feel free to point it out to us. We use this type of example as our target for performance increases. This one will take a while to fix because the order code is so key, but throw us your next problem, too.
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.