Back to Community
Platform upgrade tonight

We strive to make the Quantopian platform safe, stable, predictable, and quiet. We want you all to be able to run your algorithms at any time and get exactly what you expect. That means live trading that performs like backtests, the same backtest every day get the same backtest result every time, and so on. We want you to worry about writing brilliant algorithms and us to worry about almost everything else.

To achieve that, we do a lot of testing. Virtually every platform change gets a dry run with real, production algorithms in a staging harness before the change ships. We ship new code almost every day. The fact that you don't notice that is something that we're proud of.

As a practical matter, though, some platform upgrades are harder. This is particularly true where we are taking advantage of some relatively cutting-edge open source software. These packages move quickly, they're close to the core of what we do, and they don't always upgrade easily. Tonight is one of those nights.

We've been testing this set of software updates for weeks. We've been in email correspondence with dozens of our community members, letting them know that their algorithms are going to be affected. We've helped them update their algos so they'll run just fine. We're confident that we've found everything that affects any real-money algorithms and contest algorithms. However, we haven't used the same rigor on non-contest algorithms, and we are quite certain that some existing backtested algorithms will break. We're sorry for the inconvenience.

The biggest change we've seen is in pandas. If anywhere in your code you use this pattern:

dataframe = history(...)  
if dataframe: # This will break  
    # do things  

That's not going to work anymore. pandas changed the "truthiness" of the dataframe result. The good news is that it's trivial to change your code in a backwards compatible way. The new code is required to be more explicit and could look like either of these options:

if dataframe is None: # valid, check for existence of a dataframe  

or

if all(pd.notnull(dataframe)) # valid, check that no entry contains nan  

For the detail oriented, these are the big package upgrades tonight:

package old version new
numpy 1.8.1 1.8.2
pandas 0.12.0 0.15.2
pytz 2014.4 2014.10
scipy 0.12.0 0.15.1
statsmodels 0.5.0 0.6.1
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.

5 responses

I am seeing this, this morning. This was code that was working yesterday.

Something went wrong. Sorry for the inconvenience. Try using the built-in debugger to analyze your code. If you would like help, send us an email.  
ValueError: shapes (19,1110,1) and (1,1110,19) not aligned: 1 (dim 2) != 1110 (dim 1)  
There was a runtime error on line 60.  

code around line 60

    prices = history(3*390,'1m','price')  
    ret = prices.pct_change().dropna()  
    ret = pd.ewma(ret,span=60).as_matrix(context.stocks)  
    bnds = []  
    limits = [0,1]  
    for stock in context.stocks:  
        bnds.append(limits)  
    bnds = tuple(tuple(x) for x in bnds)  
    cons = ({'type': 'eq', 'fun': lambda x:  np.sum(x)-1.0})  
    res= scipy.optimize.minimize(variance, x0, args=ret,method='SLSQP',constraints=cons,bounds=bnds)

I have had a contest entry running for days - this upgrade caused an error in my algo and kicked me out of the contest.

Not cool.

Ouch, that is awful.

Couldn't an algorithm upgrade mechanism be implemented.
Making both old and new platform available for a fixed upgrade window, and allowing
an algorithm to switchover.

How do yall plan on doing this, in the future. Specially when there is money in play in these algorithms
I suspect this will not be the last incompatible upgrade.

Sarvi

@Savi, could you invite me to collab on the algo ([email protected])? Then I can take a look and see how to update your syntax so the algo can run. For your second question, not all algos were affected by this upgrade. For the ones that were (contest and IB), we worked with those users to update their code to run with the platform upgrade. Our goal is to support the latest modules, and when we need to upgrade, work hand-in-hand with those people affected.

@ Mohammad, we reached out individually to the people whose contest and IB algos our test environment flagged would break with the new pandas upgrade. Unfortunately, your algo was not identified and we're looking into it. In the meantime, I can work with you to update your pandas syntax and re-enter it in the contest, with its complete history. Could you also invite me to collab?

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.