Clustering of financial time series in risky scenarios