0
$\begingroup$

I am interested in replicating the performance of the eurostoxx 50 index using different statistical methods. That's what ETFs do, right? How to replicate an index using subset selection?

I think I am missing data such as the list of components of the Eurostoxx 50.

Indeed, I only have the prices of Eurostoxx 50 closures with the following code :

import pandas as pd
cols = ['Date', 'SX5P', 'SX5E', 'SXXP', 'SXXE',
        'SXXF', 'SXXA', 'DK5F', 'DKXF', 'DEL']
es_url = 'http://www.stoxx.com/download/historical_values/hbrbcpe.txt'
try:
    es = pd.read_csv(es_url,  # filename
                     header=None,  # ignore column names
                     index_col=0,  # index column (dates)
                     parse_dates=True,  # parse these dates
                     dayfirst=True,  # format of dates
                     skiprows=4,  # ignore these rows
                     sep=';',  # data separator
                     names=cols)  # use these column names

    # deleting the helper column
    del es['DEL']
except:
    # read stored data if there is no Internet connection
    es = pd.HDFStore('data/SX5E.h5', 'r')['SX5E']

# Now let's do the same for the VSTOXX data file
vs_url = 'http://www.stoxx.com/download/historical_values/h_vstoxx.txt'

try:
    vs = pd.read_csv(vs_url,  # filename
                     index_col=0,  # index column (dates)
                     parse_dates=True,  # parse date information
                     dayfirst=True, # day before month
                     header=2)  # header/column names
except:
    # read stored data if there is no Internet connection
    vs = pd.HDFStore('data/V2TX.h5', 'r')['V2TX']

import datetime as dt

cutoff_date = dt.datetime(1999, 1, 4)
# endoff_date = dt.datetime(2016, 2, 12)
data = pd.DataFrame(
{'EUROSTOXX' :es['SX5E'][es.index >= cutoff_date],
 'VSTOXX':vs['V2TX'][vs.index >= cutoff_date]})

However, I suppose that when I have this data framework of the values that make up the eurostoxx 50, closes, as well as the actions I must take in the shares, constituent I will be able to apply the following formula:

replicated_perf = ((closes - closes.iloc[0]) * constituent.loc['shares']).sum(axis=1) / (closes.iloc[0] * constituent.loc['shares']).sum()

original_perf = (data.close - data.close[0]) / data.close[0]
performance = pd.DataFrame({'replicated': replicated_perf, 'original': original_perf})
plt.figure(figsize=(12, 8))
performance.plot(figsize=(12, 8))

And get one thing like the following

introducir la descripción de la imagen aquí

$\endgroup$
  • $\begingroup$ Do all ETFs sample? No. See here for EUE iShares Core EURO STOXX 50 UCITS ETF, which invests in all (not a sample) of the stoxx. ishares.com/uk/individual/en/products/251781/… If you download Detailed Holding you can see the current holdings names and their weight. You could use this as a basis for your project. $\endgroup$ – Alex C Oct 14 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.