• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

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