The Account Window utilizes the following formulas to calculate P&L: Unrealized P&L is the difference between the current market value of your open positions and the average cost, or Value – Average Cost; Realized P&L shows your profit on closed positions, which is the difference between your entry execution cost and exit execution cost, or (execution price + commissions to open the position) – (execution price + commissions to close the position).
The Order Management page on TWS utilizes two different P&L calculation methods. It is for the account holder to decide which calculation method they wish to have displayed: Daily P&L is calculated for all positions you currently hold using the new position calculation and the formula (current price) – (prior day’s closing price) x (total number of outstanding shares); while New Position P&L is calculated for transactions executed today using the formula (current price) – (purchase price) x (number of outstanding shares purchased today).