Investors & landlords

Your example was very helpful.  What worried me is that I have ordinary gain and capital loss in the same transaction.  Is that okay?