Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Preloading batch transform window so trading starts sooner

To time-align comparisons against the benchmark, it would be convenient if the backtester could preload the batch transform window, so that the algorithm had enough data to trade on the first day of a backtest.

Example: At present, if a batch transform has a 60-day window, the algorithm won't start trading until about three months (60 trading days) after the backtest starts. Meanwhile, the benchmark fluctuations have been recorded throughout those first three months. So at the end of one year, the results compare a year of benchmark performance to only nine months of algorithm performance.

If the backtester preloaded the window, the algorithm and the benchmark would both be measured over the same full year, and the comparison would be more meaningful.

For live trading, preloading would be even more important. It would be painful to have to wait three months to start trading while the batch window slowly filled up day by day.

2 responses

That's a good point. We did it that way originally to avoid all sorts of annoying issues with IPOs and other events that make the "leading edge" of data be inconsistent. We should probably make the change you describe, and provide other tools to handle the problems of the leading edge data.

Two notes that help a little:

  • If you use set_universe, then the batch_transform data is pre-loaded as you envision. I agree that is inconvenient if you have a specific stock you want to trade, but it's at least possible to do it that way until we make the change you suggest.
  • For live trading, we're going to "warm up" everyone's algorithm using recorded data. So, say it's after market close, and you decide your algo is ready to go live the next day, and you flip the switch. We'll fire up the algo and "warm up" any batch transforms or simple transforms. When it starts trading in the morning, it will be trading with 60 days (or whatever) of data already in the window.
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.

Thank you for the clarifications -- it's good to hear that live trading will start with preloaded data for transforms.