Create moving_window_cq_function