Piecewise trend approximation in financial time series