Fix problem generating trades