Corrected logic for calculating position P&L. Wrote and passed groovy unit test to verify.