Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Discrepancy actual portfolio positions versus ordered weights

Hi,

Hope everyone is staying safe with corona and not too bored :)
I'm new to Quantopian and have been trying as an exercise to build a simple fundamental indexing strategy for testing purposes. In my algorithm, you'll see I'm just selecting the top 10 stocks based on company sales and then set my target weights based on the relative sales of each security in the basket. I'm printing out the orders and the actual positions to the console and I'm noticing some orders don't get fulfilled (for instance 'BRK_A'). What is exactly happening here? And secondly, how could I check for this beforehand such that I'm sure to adapt my weights to be 100% invested at each rebalancing step?

Thanks a lot for the help!
Thibault

2 responses

First off, welcome to Quantopian. The simple answer why your algorithm isn't buying BRK_A is that it currently costs ~$265,000 per share. Your account only starts with $10,000 so it doesn't have enough buying power to buy even a single share. You may even have a hard time buying such stocks as AMZN which is around ~$1900 per share. Perhaps calculate the dollar value associated with each weight and exclude if that is less than the stock price? This will ensure you can at least afford one share.

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.

Aaah, ok makes a lot of sense, of course :) Thanks!