Sort trades properly.