Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Rebalancing the stocks with 1/N algorithm

Hi All,

I am totally new here, I dont know where to start and end. I have to do the following assignment by tomorrow. Can anyone guide me or help with it. Thank you. You can reach me at : [email protected] if you have any further questions.

I want to implement a 1/N algorithm where you distribute the funds available ( say $1,000,000) in buying the stocks (some 100 different varieties, so every stock should have $10,000 worth: for example Facebook stock price is $40 and google’s $50, we should have 250 of FB and 200 of google) equally from available that are being traded. Rebalancing is maintaining the stock worth to 1/N of the total funds after every month. Whenever the share price increases decreases, we need to rebalance the total stocks without violating the 1/N ratio of that particular stock. We also need to implement the same once at the month of every month and at the end of every year too.

Thank you very much.

5 responses

Hi Swaroop,

This should get you started.

Grant

Hi Grant,

Thank you very much. I can now work and tweak on your template. Can you please refer/ suggest me some tutorials related to this algorithm where I can learn about the inbuilt functions and libraries? There is literally an universe of learning material everywhere, so it is kind of hard to find the relevant material.

Thanks in advance

It really depends on specifically what you need to do. For example, it sounds like you need to have a portfolio of 100 stocks. How should they be picked?

There is no selection criteria, I need to pick all the stocks available. I figured out there are around 8000 different stocks, but, I am using Q1500US and Q500US because I dont know how to use all the 8000.

This version should be an improvement. --Grant