A simple Python code to pick the lowest correlated stocks from S&P 500

Image for post
Image for post
Photo by Markus Winkler on Unsplash

Portfolio investing is a fascinating kind of investment that can potentially lead to satisfactory returns. According to Modern Portfolio Theory, it’s always a good idea to select stocks or ETFs that show a low correlation.

Let’s see why and how to select stocks measuring their correlation in Python.

Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.

What is linear correlation?

Correlation between stocks is a measure of how the returns of a stock interfere with the returns of another one. If two stocks are highly correlated, they will likely move in the same direction (i.e. if a stock price rises, the other stock price rises too) or in the opposite direction. …


Let’s see a simple but effective trading tool in Python

Image for post
Image for post
Image by the author

Quantitative traders often look for trading tools that can spot trends or reversals. Such tools should self-adapt to market conditions and try to describe the current situation in the most accurate way.

In this article, I’ll talk about Bollinger Bands and how to work with them in Python.

Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.

What are the Bollinger Bands?

Bollinger Bands are a tool introduced by the quantitative trader John Bollinger in the 1980s. They are made by two lines that wrap the price time series in a way that is related to volatility. The higher the volatility, the wider the bands. …


Writing can be hard, but consistency is the key

Image for post
Image for post
Photo by Patrick Fore on Unsplash

Medium and other services have allowed professional writers to earn money writing without using ads, affiliate marketing, and other non-writing-related stuff. It’s a great revolution for professional writers who can finally see some money from their work without needing a publisher or a magazine to work for. Writing is fun, but doing it professionally needs consistency and effort. Just any other kind of job, it may need some tricks to get some nice results.

Let’s see how to gain consistency in writing 2.000 a day.

Consistency

Writing is a job that needs effort to be profitable. If you want to become a professional writer, you must have consistency. It simply means you have to write every (business) day. Period. There are no other simple ways to do it. …

About

Gianluca Malato

Theoretical Physicists, Data Scientist and fiction author. I teach Data Science, statistics and SQL on YourDataTeacher.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store