Hi Jimmy,
Thanks for reporting this issue. I don't think you are doing anything wrong. The problem is with how we chose to model Google's recent stock dividend.
The stock issued by Google was a new share class, and so not exactly a split because there are two securities as a result of the transaction, not one. We chose to represent the event as a stock distribution, where the new shares are added to the portfolio (which is what happened in reality). As a result, there is a discontinuity in the price of GOOG_L. The attached backtest is an algorithm that sets the benchmark to GOOG_L, and also puts 100% of the portfolio into GOOG_L. As you can see from the equity curve in the backtest results, the benchmark has the discontinuity, whereas the algorithm does not. This is because the algorithm's portfolio also includes GOOG shares.
History and the benchmark will show the simple timeseries of GOOG_L prices, which include the discontinuity. The result of the history command was a conscious choice, however, we're open to suggestions. Similar, albeit less dramatic, drops also occur for dividends.
The benchmark behavior, however, is an oversight. Cash dividends are modeled as re-invested in the benchmark calculation, and stock dividends should be added to the benchmark portfolio, not ignored as they are now.
thanks,
fawce
p.s. You'll need to clone this algo and run a "full backtest" to see the positions data.
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.