#### Returns ####
returns = (fundos_norm / fundos_norm.shift(1)) - 1
# Resampling to yearly (business year)
yearly_quotes = fundos_norm.resample('BA').last()
# Adding first quote (only if start is in the middle of the year)
yearly_quotes = pd.concat([fundos_norm.iloc[:1], yearly_quotes])
EW = pl.compute_portfolio(ETFs, [0.50, 0.50])
EW.columns = ['ETFs']
portfolios = pl.normalize(pl.merge_time_series(fundos[['4Fundos EW']], EW).dropna())
portfolios = pl.normalize(portfolios['2016-11-11':])
pl.ichart(portfolios, yticksuffix='€')
pl.ichart(pl.compute_drawdowns(portfolios), yticksuffix='%')
pl.compute_performance_table(portfolios)