How to optimize against theoretical weights: R

Joined
9/13/17
Messages
11
Points
13
Hey guys, pretty simple question:

Is there a package/function in R for optimizing share purchases relative to a desired weighting?

Say for example I want my hypothetical portfolio weights to be 0.2, 0.2, 0.2, 0.2, & 0.2 (20% each) for 5 stocks, however each of these 5 stocks have different prices. So is there a package in R where I can insert the current value of each stock and calculate the combination of stocks/shares that has the lowest difference between my desired weights and my actual ones?

Cheers for any help.
 
Back
Top Bottom