While it's true that your hips rocking indicates that the seat is too high, there is a different rule of thumb for knee pain related to the fore and aft position of the saddle. It's easy to remember:
* If your knee hurts in front, your seat is too far forward.
* If your knee hurts in the back, your seat is to far backward.
The most important thing to remember is that small changes can make a big difference.