Loop Stock Query