Question: Using python in google collab, could you please provide screenshots of the code used! You will invest $ 4 0 , 0 0 0 in

Using python in google collab, could you please provide screenshots of the code used!
You will invest $40,000 in the following assets:
Berkshire Hathaway Inc. (BRK-A),
Microsoft Corporation (MSFT),
Starbucks Corporation (SBUX),
Apple Inc. (AAPL),
The Cheesecake Factory (CAKE).
Using the yfinance package, download the daily returns of these assets from May 1,2019(inclusive) to May 1,2024(exclusive).
Utilize the skfolio package to compute the optimal portfolio that maximizes the Sharpe Ratio, allowing short-selling with asset weights as low as -100%.
Assume that the daily risk-free rate is 2%/252.
Use the standard deviation of daily returns as the measure of risk.
Suppose you invested in the optimal portfolio on May 21,2024.
On that day, the close price of SBUX was $77.72.
How many shares of the Starbucks Corporation did you buy or borrow to invest in this portfolio?
Note that if you borrow shares, the investment amount will be negative.
Round your answer to one decimal place, as some brokers allow you to purchase fractional shares.
Thank you very much!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!