Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Robo-Advisor with Python

You're reading from   Robo-Advisor with Python A hands-on guide to building and operating your own Robo-advisor

Arrow left icon
Product type Paperback
Published in Feb 2023
Publisher Packt
ISBN-13 9781801819695
Length 250 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Aki Ranin Aki Ranin
Author Profile Icon Aki Ranin
Aki Ranin
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Part 1: The Basic Elements of Robo-Advisors
2. Chapter 1: Introduction to Robo-Advisors FREE CHAPTER 3. Chapter 2: What Makes Up a Robo-Advisor? 4. Chapter 3: Robo-Advisor Platforms versus Algorithms 5. Chapter 4: Leasing, Buying, or Building Your Own Robo-Advisor 6. Part 2: Building Your Own Robo-Advisor
7. Chapter 5: Basic Setup and Requirements for Building a Robo-Advisor 8. Chapter 6: Goal-Based Investing 9. Chapter 7: Risk Profiling and Scoring 10. Chapter 8: Model Portfolio Construction 11. Chapter 9: Investment Projections 12. Chapter 10: Account Opening and KYC 13. Chapter 11: Funding Your Account 14. Chapter 12: Order Management and Execution 15. Part 3: Running and Operating Your Own Robo-Advisor
16. Chapter 13: Performance Reporting 17. Chapter 14: Rebalancing 18. Chapter 15: Dividends and Fee Management 19. Chapter 16: Regulations for Robo-Advisors 20. Index 21. Other Books You May Enjoy

Creating multiple portfolios using risk bands

Before we can get to the MPT-specific concerns, we need to get some market data and format it specifically for the modules we will be using. If you end up using different modules or writing your own efficient frontier code, you may need different data formatting. Now, let’s download some market data:

df = yf.download("SPY TLT",group_by="Ticker",period="20y")
df

We just need one simple command to download a lot of data, in fact, daily prices for 20 years for the two ETFs in our portfolios. To see what we got, you can simply run the DataFrame object by calling df. We should see something like this:

Figure 8.5 – A sample of our first market data

Figure 8.5 – A sample of our first market data

We can see that the resulting DataFrame has an interesting structure with two layers of columns. We have various numeric values for both SPY and TLT one after another, organized by the date as the index. What we need is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image