Fix logic and math issues in the default trader class