  In this paper, we give two precise definitions of a higher order oscillating
sequence and show the importance of this concept in the study of Sarnak's
conjecture. We prove that any higher order oscillating sequence of order $d$ is
linearly disjoint from all affine distal flows on the $d$-torus for all $d\geq
2$. One consequence of this result is that any higher order oscillating
sequence of order $2$ is linearly disjoint from all affine flows on the
$2$-torus with zero topological entropy. In particular, this reconfirms
Sarnak's conjecture for all affine flows on the $2$-torus with zero topological
entropy and for all affine distal flows on the $d$-torus for all $d\geq 2$.
