quick fix in end cases in the similarity measure.
calculating daily returns on close only