$30 off During Our Annual Pro Sale. View Details »

Karen Rubin - Building a Quantitative Trading Strategy To Beat the S&P500

Karen Rubin - Building a Quantitative Trading Strategy To Beat the S&P500

Two years ago, Karen embarked on a project to learn how to research, write and trade algorithms to invest in the market. She re-learned python and explored what would happen if you invested in women-led companies over a 12-year period. In this talk, she will walk through the highs and lows of her journey from initial data gathering, through writing a strategy to validation and trading.

https://us.pycon.org/2016/schedule/presentation/1697/

PyCon 2016

May 29, 2016
Tweet

More Decks by PyCon 2016

Other Decks in Programming

Transcript

  1. Quantopian.com
    Building a Quantitative Trading
    Strategy To Beat the S&P500

    View Slide

  2. Quantopian.com
    Disclaimer
    Quantopian provides this presentation to help people write trading algorithms - it is not intended to
    provide investment advice.
    More specifically, the material 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 or other services by
    Quantopian.
    In addition, the content neither constitutes investment advice nor offers any opinion with respect to
    the suitability of any security or any specific investment. Quantopian makes no guarantees as to
    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.

    View Slide

  3. Quantopian.com
    VP of Product, Quantopian

    View Slide

  4. Quantopian.com
    As of 2013, women….

    View Slide

  5. Quantopian.com
    12.9% of
    top management

    View Slide

  6. Quantopian.com
    12.7% of boards

    View Slide

  7. Quantopian.com

    View Slide

  8. Quantopian.com

    View Slide

  9. Quantopian.com
    What if you invested in
    female CEOs?

    View Slide

  10. Quantopian.com

    View Slide

  11. Quantopian.com

    View Slide

  12. Quantopian.com
    Jan 02 Dec 14
    Any CEOs start? —-> BUY 500 Shares
    Any CEOs end? —-> SELL all
    Move to next day

    View Slide

  13. Quantopian.com

    View Slide

  14. Quantopian.com

    View Slide

  15. Quantopian.com
    511%
    My Algorithm

    View Slide

  16. Quantopian.com
    511%
    My Algorithm
    122%
    SPY
    389%
    Difference

    View Slide

  17. Quantopian.com

    View Slide

  18. Quantopian.com
    Jan 02 Dec 14
    Any CEOs start? —-> BUY
    Any CEOs end? —-> SELL
    Rebalance
    Move to next day

    View Slide

  19. Quantopian.com

    View Slide

  20. Quantopian.com
    339%
    My Algorithm
    122%
    SPY
    217%
    Difference

    View Slide

  21. Quantopian.com

    View Slide

  22. Quantopian.com
    339%
    My Algorithm
    122%
    SPY
    217%
    Difference

    View Slide

  23. Quantopian.com
    and…
    Could it be…

    View Slide

  24. Quantopian.com

    View Slide

  25. Quantopian.com
    320%
    My Algorithm
    122%
    SPY
    197%
    Difference

    View Slide

  26. Quantopian.com

    View Slide

  27. Quantopian.com
    What about sector bias?

    View Slide

  28. Quantopian.com

    View Slide

  29. Quantopian.com
    275%
    My Algorithm
    122%
    SPY
    153%
    Difference
    REDO GRAPH

    View Slide

  30. Quantopian.com
    SPY is the wrong benchmark

    View Slide

  31. Quantopian.com
    339%
    My Algorithm
    251%
    RSP
    Equal Weighted S&P500
    122%
    SPY

    View Slide

  32. Quantopian.com
    Female CEOs
    Male CEOs
    The sample size is too small.

    View Slide

  33. Quantopian.com

    View Slide

  34. Quantopian.com

    View Slide

  35. Quantopian.com

    View Slide

  36. Quantopian.com
    176%
    My Algorithm
    Eventvestor CEO Changes
    103%
    My Algorithm
    Fortune 1000
    86%
    RSP

    View Slide

  37. Quantopian.com

    View Slide

  38. Quantopian.com
    176%
    My Algorithm
    Eventvestor CEO Changes
    103%
    My Algorithm
    Fortune 1000
    86%
    RSP

    View Slide

  39. Quantopian.com
    In Sample Out of Sample
    What does your out-of-sample look like?

    View Slide

  40. Quantopian.com
    In Sample Out of Sample
    What does your out-of-sample look like?

    View Slide

  41. Quantopian.com
    In Sample Out of Sample
    What does your out-of-sample look like?

    View Slide

  42. Quantopian.com
    332%
    My Algorithm
    Fortune 1000
    184%
    RSP
    130%
    Difference

    View Slide

  43. Quantopian.com
    Your benchmark is still wrong.

    View Slide

  44. Quantopian.com

    View Slide

  45. Quantopian.com
    332%
    My Algorithm
    Fortune 1000
    299%
    Q1000
    17%
    Difference

    View Slide

  46. Quantopian.com
    Are you going to live trade this?

    View Slide

  47. Quantopian.com

    View Slide

  48. Quantopian.com

    View Slide

  49. Quantopian.com
    229%
    Female CEOs Q1000
    Eventvestor CEO Changes
    91%
    RSP
    138%
    Difference

    View Slide

  50. Quantopian.com
    229%
    Female CEOs Q1000
    Eventvestor CEO Changes
    89%
    RSP
    151%
    Female CEOs Q2000
    Eventvestor CEO Changes
    275%
    Female CEOs Q500
    Eventvestor CEO Changes

    View Slide

  51. Quantopian.com
    275%
    Female CEOs Q500
    Eventvestor CEO Changes
    46%
    Male CEOs Q500
    Eventvestor CEO Changes
    89%
    RSP

    View Slide

  52. View Slide

  53. Recent 24 hour period of backtests. Red dots are location of people running backtests.
    ~75,000 registered users, ~1,000 daily active quants, 60% from outside the US.
    Global Community

    View Slide

  54. Quantopian.com
    quantopian.github.io/zipline/
    quantopian.github.io/pyfolio/
    quantopian.com/femaleCEOs
    @karenrubin
    [email protected]

    View Slide

  55. Quantopian.com

    View Slide

  56. Quantopian.com
    267%
    My Algorithm
    122%
    SPY
    145%
    Difference
    REDO GRAPH

    View Slide

  57. Quantopian.com
    THROUGH 2016

    View Slide

  58. View Slide

  59. View Slide

  60. View Slide

  61. View Slide

  62. Quantopian.com
    30%
    Female CEOs Q1000
    Eventvestor CEO Changes
    1.5%
    RSP
    28.5%
    Difference

    View Slide

  63. Quantopian.com

    View Slide

  64. Quantopian.com
    1.52%
    Q1000 Seeded
    Eventvestor CEO Changes
    1.48%
    RSP
    0.04%
    Difference

    View Slide

  65. Quantopian.com

    View Slide