Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portfolio construction issue with irregular stock tickers #22

Open
unitroot opened this issue Jul 28, 2016 · 0 comments
Open

Portfolio construction issue with irregular stock tickers #22

unitroot opened this issue Jul 28, 2016 · 0 comments

Comments

@unitroot
Copy link

First off, I am a big fan of your work and all the code runs smoothly most of the time. However, I encountered an issue with the portfolio construction procedure in two instances:

  1. the code appears to stop working as soon as one of the stock price series from yahoo finance references an irregular stock ticker (in my case it was MOG-A) which concerns most companies with two types of shares
    If I run this code: data$weight[week.ends,] = ntop(prices[week.ends,], n)
    I get this error message:
    Error in colnames<-(*tmp*, value = c("..." :
    length of 'dimnames' [2] not equal to array extent

  2. when the number of stocks to be included in the portfolio optimization exceeds 20, the code tends to break as well.

do you have any quickfix for these issues? my guess is that the main problem is that your code uses price data in environments rather than objects.

Cheers
MR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant