realized pnl calculation