We present an experimental demonstration of a deterministic optical rocking ratchet. A periodic and asymmetric light pattern is created to interact with dielectric microparticles in water, giving rise to a ratchet potential. The sample is moved with respect to the pattern with an unbiased time-periodic rocking function, which tilts the potential in alternating opposite directions. We obtain a current of particles whose direction can be controlled in real time and show that particles of different sizes may experience opposite currents. Moreover, we observed current reversals as a function of the magnitude and period of the rocking force.