calculate trades