Using python in google collab, could you please provide screenshots of the code used! ...

80.2K

Verified Solution

Question

Finance

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!!

Answer & Explanation Solved by verified expert
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students