runtnd function

Running trends on time windows of different lengths