We present a de-trending algorithm for the removal of trends in time series. Trends in time series could be caused by various systematic and random noise sources such as cloud passages, changes of airmass, telescope vibration or CCD noise. Those trends undermine the intrinsic signals of stars and should be removed. We determine the trends from subsets of stars that are highly correlated among themselves. These subsets are selected based on a hierarchical tree clustering algorithm. A bottom-up merging algorithm based on the departure from normal distribution in the correlation is developed to identify subsets, which we call clusters. After identification of clusters, we determine a trend per cluster by weighted sum of normalized light-curves. We then use quadratic programming to de-trend all individual light-curves based on these determined trends. Experimental results with synthetic light-curves containing artificial trends and events are presented. Results from other de-trending methods are also compared. The developed algorithm can be applied to time series for trend removal in both narrow and wide field astronomy.