Diversify your portfolio by adding single stock

12 April 2022
Complete Guide for CTO & IT Directors
Microservices under X-Ray Three books image Download free ebook

The main strategy for creating a successful portfolio is to diversify your investments. If you put all your funds into one asset, you can easily lose a lot of money. When you invest in assets that behave differently on the market, you minimize the risk that all of them will lose their value simultaneously.

Expert knowledge vs. data-driven solutions

There are two ways to approach a data science problem: expert knowledge and data-driven solutions. In our case, expert knowledge would be value-based investments. You must know the companies in your current portfolio and try to find others that will behave differently. For example, you can look in industry sectors that are not dependent on sectors from your portfolio.
The data-driven approach would be to look at a mathematical representation of a diversified portfolio, i.e, a correlation. If the prices of two assets are not correlated, they might be independent. Therefore, the key to portfolio diversification would be to add an asset not correlated with others.

Assets correlation

When there are more than two assets in a portfolio, it is harder to determine whether or not they are correlated. For three assets you will have three correlation factors, for four assets six factors, etc. Having to consider varying amounts of target values makes this approach difficult to use. There is one numeric value that determines how much a set of assets is uncorrelated – the determinant of the correlation matrix. The higher the determinant, the more uncorrelated the portfolio is.
We could compute this determinant for every potential portfolio – our current assets plus one asset candidate – and pick the candidate with the highest determinant. However, that approach is time consuming, and the time required grows with the size of our portfolio. Instead, we can use an approximated solution. Let’s approximate our portfolio using the weighted mean of assets’ prices. Weights used are assets’ percentages of total portfolio value. For example, say we have three assets:

– A worth $250
– B worth $750
– C worth $1000

The total portfolio value is $2000, so A is 12.5%, B is 37.5% and C is 50% of the total portfolio value. When averaging the portfolio price over time, we will use these values as weights. Using the approximation, we can compute a simple correlation factor for every asset candidate; this approach is less time consuming and more resource friendly.
To check if the approximation is working, we can compute determinants for the example portfolio and plot them against the approximated correlation factors. We should see a descending trend.

Picking asset candidates

When selecting stock to be added to our portfolio, lack of correlation is not the only factor to consider. We should also consider the stocks’ likelihood to perform well in the future. Again, we have two ways to tackle that problem. The expert knowledge approach would be to find a set of least correlated assets and analyze each one to find the most promising asset. However, that solution could be tricky since selected stocks may not be our area of expertise.
The data-driven approach would be to use machine learning to find the most promising assets and pick one of the least correlated ones. The most straightforward model to accomplish this would be one that predicts stock prices. Many have tried doing that, and many have failed. A less rigorous model would predict whether particular assets will outperform some mean value. In the case of the US stock market, that would be the S&P 500 Index.
Data we can use for such a model consists of companies’ income statements, balance sheets, and cash flow statements. We can also use variables derived from the stock prices such as returns from the last month, quarter, and year. Feeding all that data into an algorithm such as eXtreme Gradient Boosted Trees yields a model that allows us to order assets and look only at the most promising ones.

Data-driven solution to portfolio diversification

Now that we have all the building blocks, we can recap our data-driven solution. The first step would be ranking stocks based on their likelihood to out-perform the S&P 500 Index. For the high-ranking stocks, we would then compute their correlation factor with our portfolio. We would approximate our portfolio using the weighted mean of individual assets’ prices and choose the asset that correlates the least. To determine how much of the asset to buy, we could use the Markowitz Portfolio Theorem, which allows optimization of capital distribution between assets to reach the best returns-to-risk ratio.

Michał Olędzki

Latest Posts
gregg castano news direct

How to Pick a Good Software Partner? Q&A with Gregg Castano of News Direct  

A few years ago, we had the opportunity to work with News Direct on developing their platform. After carefully analyzing their needs, we’ve helped them design the system and developed a microservices-based architecture incorporating state-of-the-art modern technology allowing for communication using both synchronous and asynchronous calls to ensure high system flexibility and scalability. The main […]

/
cert pinning android

Mobile Development and Security: Certificate Pinning on Android

In today’s increasingly interconnected digital world, the importance of security for mobile apps and web services cannot be overstated. As cyber threats evolve, so must the defenses and measures we deploy to safeguard sensitive data and maintain trust. One of the pivotal practices in enhancing network security is certificate pinning, a technique that ensures a […]

/
django apps

Django Apps, Projects, and Other Caveats

Django, emerging as a significant player in the realm of web frameworks, stands out as a Python-based toolset that revolutionizes the way developers approach web application development. It is not merely a framework but a holistic environment that encapsulates a developer’s needs for building robust, efficient, and scalable web applications. Born out of a practical […]

/
rxjs react

RxJs & React: Reactive State Management

In the ever-evolving realm of web development, the quest for efficient, scalable, and maintainable tools never ends. Two such tools, React and RxJS, have garnered significant attention in the recent past. React, the brainchild of Facebook focuses on crafting intuitive user interfaces by leveraging a component-based architecture. On the other hand, RxJS offers a fresh […]

/
css class override

CSS Class Override: How To Add Custom Styles The Right Way?

In CSS, class overriding allows developers and designers to control web page styles. Find out how it works and how to use it for adding custom styles. CSS (Cascading Style Sheets) is a language used to style documents written in markup languages, such as HTML, XHTML, or SVG. It defines styles for web pages and […]

/
new york tech meetup

New York Tech Meetup Scene

In the bustling landscape of New York’s tech scene, a vibrant array of events and meetups provide a dynamic platform for knowledge exchange, networking, and innovation. Tech meetups, characterized by engaging presentations from industry experts, foster an atmosphere of collaborative learning and idea sharing. How to engage with that type of event? What To Expect […]

/
Related posts
gregg castano news direct

How to Pick a Good Software Partner? Q&A with Gregg Castano of News Direct  

A few years ago, we had the opportunity to work with News Direct on developing their platform. After carefully analyzing their needs, we’ve helped them design the system and developed a microservices-based architecture incorporating state-of-the-art modern technology allowing for communication using both synchronous and asynchronous calls to ensure high system flexibility and scalability. The main […]

/
new york tech meetup

New York Tech Meetup Scene

In the bustling landscape of New York’s tech scene, a vibrant array of events and meetups provide a dynamic platform for knowledge exchange, networking, and innovation. Tech meetups, characterized by engaging presentations from industry experts, foster an atmosphere of collaborative learning and idea sharing. How to engage with that type of event? What To Expect […]

/
product roadmap example

Which Way To Go – Product Roadmap Example And Insights

A quick overview of product roadmaps, not only for product managers. Briefly, What Is A Product Roadmap? A product roadmap is a visual representation that outlines a product development and evolution over a defined period, serving as a communication tool to align stakeholders around the product’s direction, goals, and milestones. In general terms, the roadmap […]

/
smart retail

Smart retail solutions: how can they help your business grow?

Smart technologies are transforming the retail industry at an increasing rate. Brick-and-mortar stores are going digital to drive more sales and keep up with the competition. Find out about top solutions fueling retail growth and how they can benefit your business. Blockbuster, Borders, Barnes & Noble, Sears, and Toys R Us are but a few […]

/
predictive analytics retail

Predictive Analytics: Retail Industry Use Cases

Retail businesses have always been driven by data, whether it’s sales figures, inventory levels, or customer behavior. With the rise of predictive analytics, retailers have the ability to analyze large volumes of data to uncover data-driven insights and patterns that can help them make more informed decisions. Predictive analytics is a branch of advanced analytics […]

/
project manager vs product manager

Product Manager vs Project Manager: Main Differences and Similarities

In today’s fast-paced and highly competitive business world, organizations need to have a clear understanding of the differences between a product manager and a project manager. While both roles are critical to the success of a company, they have distinct roles and responsibilities. In this article, we will explore the similarities, differences, and roles of […]

/
Talk with experts

We look forward to hearing from you to start expanding your business together.

Email icon [email protected] Phone icon +1 (888) 413 3806