Trajectories of spherical dielectric particles carried across an optical standing wave by a flowing medium are investigated. Trajectories are determined by a three-dimensional Monte Carlo calculation that includes drag forces, Brownian motion, and optical gradient forces. We analyze the case of polystyrene particles with radii of order 100 nm carried across a Gaussian-mode standing wave by slowly flowing air. Particles are injected into the flowing air from a small source area such as the end of a capillary tube. Different sizes are dispersed continuously in space on the opposite side of the standing wave, demonstrating a practical way to sort particles. Certain discrete values of particle size show no interaction with the optical field, independent of intensity. These particles can be sorted with exceptionally high resolution. For example, particles with radii of 275 nm can be sorted with 1 nm resolution. This sorting scheme has the advantages of accommodating a high throughput, producing a continuous stream of continuously dispersed particles, and exhibiting excellent size resolution. The Monte Carlo results are in agreement with those obtained by a much simpler, and faster, fluid calculation based on effective velocities and effective diffusion coefficients, both obtained by averaging trajectories over multiple fringes of the optical field.