Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Quantopian Workshop in London

NOTE: FOR WORKSHOP USE ONLY, PLEASE DON'T COMMENT OTHERWISE.

Thanks,
Delaney

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.

6 responses

Morgan

Here's mine..an adjustment of the Kalman filter method for a more diverse stock pool
Thanks for an interesting workshop
Simon

Submission 1: Looks like there are some leverage issues caused by the absolute amount of dollars ordered in line:

or i in range(-20, 0):  
        amount = -int(size/data[gaps[i][0]].price)  
        order(gaps[i][0], amount)  
        log.info('entry %s %s' % (gaps[i][0], amount))

It would be good to normalize the amount by the total portfolio value, either manually or by using order_target_percent.

Submission 2: This is a more promising algorithm, cloned from an algorithm released with the Kalman Filters Lecture. It uses Kalman Filters to try to make some pair trades more efficient. The returns could use some work, although a pair trade might definitely break down during a 2008-like crash. The issue is that relationships between companies break, and standard economic factors go out the window. The more pairs you had trading the better, but it still might be a good idea to go to cash once you realized something had happened. It rides out the first part of the crisis well, but that could be luck. The market beta exposure is consistently low, which is good, but the sharpe ration is inconsistent, spending a good deal of the time in negative territory. The Fama-French factor exposures are low, which is also good. Overall the algorithm copes quite well with this bad period, but work could be done on figuring out more consistent pairs, and potentially a liquidation condition based on detection of whether the pairs were still cointegrated. Justin Lent shared something to do this here: https://www.quantopian.com/posts/pair-trade-with-cointegration-and-mean-reversion-tests

Winner: Submission 2

Hi Delaney - thank you for hosting the workshop. Clearly I've been a bit too focused on the Fetcher problems we discussed. Here is a ridiculous backtest, but mostly because I have spent no time on the trade execution side of the algo. Hopefully I score some points for finally getting Fetcher to work at least partially.

Thank you for the excellent workshop. It's really helped me get started. I would recommend to others!

Thanks everybody for coming and thanks for the kind words, Dan. I hope to be able to set something else up in London soon.