post list
QuantDare
categories
python

python

python

## Prices convolution, a practical approach

### fuzzyperson

There are some things impossible to quantify. How delicious are your mom’s cookies or how exciting is to train a neural network, for example. But financial markets are made of numbers – among other things. They should be measurable, quantifiable. Nobody said it was easy. But we dare.

# Euro Stoxx Strategy with Machine Learning

### fjrodriguez2

#### 15/07/2016

In this post we are going to develop an initial approach to an investment strategy which aims to beat Euro Stoxx 50 Index. With this objective in mind, we are going to use Machine Learning and Data Science techniques (for some background, you can read the post titled “Machine Learning: A Brief Breakdown“).

## How do we beat Euro Stoxx 50 Index?

We will focus on the strategy’s steps at a high level, without explanation of the core mathematical methods, Machine Learning techniques nor Data Science algorithms used to develop it.

It’s worth noting that the next steps have to be repeated for each day in our simulation period:

• Step 1: We get all the close prices for each stock in the current Euro Stoxx 50 composition. Our series date from the first date of the youngest stock, to today’s previous working date.
• Step 2: Using the same dates from Step 1, we have to obtain all the close prices of Euro Stoxx 50 sectorial indexes (we use 16 indexes).
• Step 3: We cluster the stocks according to their maximum historical similarity to the sectorial indexes (similarity: distance 1 – correlation).
• Step 4: We rank the stocks estimates using a Random Forest algorithm:
• Step 4.1Train. We calculate some historical quantitative features for the stocks, such as last year’s volatility or the average of the last 100 daily returns. Once we know the most profitable stocks, we train the Random Forest like a regression problem.
• Step 4.2Prediction. We request that the Random Forest algorithm predicts the stock ranking according to the built model in Step 4.1.
• Step 5: We create an equally weighted portfolio according to sectors and, inside them, we allocate the weights directly proportional to the ranking of stocks.

## Results

We repeat these steps from 01/01/2006 to 30/06/2016 getting the next comparison: