You might buy when the stochastic value is greater than 50 and sell when the stochastic value is less that 50. The stochastic formula used in this way is trend following.
Or buy above 80, sell below 20.
You might explore different values and time constants, discover what combinations test...