Interactive Brokers trading platforms use Average Cost Accounting when calculating Realized P&L and your cost price (average price) is synced to your statement once every evening. Your statements, however, will use the tax lot matching method you have selected which may be something other than FIFO.
Why is my realized P&L different in TWS than my statement?
Powered by IBot
How do I adjust average price in TWS?
What is an "odd lot" in stocks?
How can I update cost basis information on IBKR Mobile?
The Annual Report does not match the Form T5008.