debuged code with working trading profile

working trading profile based on the "percentage rule"