eleow / roboadvisorSystem

Robo-advisor
MIT License
38 stars 12 forks source link

Error in rebalancing for both MPT and constant-rebalancing algorithms, if ticker does not exist/ is unlisted #5

Closed eleow closed 4 years ago

eleow commented 4 years ago

In some cases, the ticker might not exist for certain periods, eg one of the tickers is not listed yet. This will cause error in the algorithms because it tries to perform means-variance optimisation on an empty history vector. Similarly for constant-rebalancing, it will attempt to allocate shares to a stock that does not yet exist! image

Stocks that do not exist on the "current" date, should be filtered away before performing means-variance optimisation and constant-rebalancing.

Weights for constant-rebalancing should also be automatically adjusted/normalised. For example, consider a portfolio of 4 assets, with the following weights- A: 0.25, B: 0.25, C: 0.25, D: 0.25. If C does not exist, then weights should be automatically redistributed to A:0.33, B:0.33, D:0.33