What can cause a child to rock back and forth several times of day?

Self stimulation. Some young children, and it is normal behavior rock back and forth or sit on edges of chairs in order to self stimulate, ie.. Masturbate. It is normal but may be mortifying if he chooses to do it in front of a living room full of guests. If your child is a bit older than a toddler you can let him know where it is acceptable to do, and if he is younger maybe try changing activities.