Skip to content

IBKR Flex Query import handles dividend reversal as a positive dividend #5930

Description

@izi77

Describe the bug

When importing an IBKR Flex Query XML containing a dividend reversal, Portfolio Performance imports the reversed dividend as a positive cash amount.

The number of shares is imported as negative, but the dividend amount remains positive. This causes an incorrect cash account balance.

Example from the IBKR Flex Query import:

Date: 2026-06-16

  1. Dividend: +0.70 USD
    Shares: -8

  2. Dividend: +0.76 USD
    Shares: +9

  3. Transfer (Outbound): -0.06 USD

The first dividend is a reversal of the original dividend and should therefore reduce the cash account by 0.70 USD.

Actual calculation:

+0.70 USD + 0.76 USD - 0.06 USD = +1.40 USD

Expected calculation:

-0.70 USD + 0.76 USD - 0.06 USD = 0.00 USD

As a result, the USD cash account incorrectly shows a balance of 1.40 USD.

To Reproduce

Steps to reproduce the behavior:

  1. Create an IBKR Flex Query containing a dividend and its subsequent reversal.
  2. Export the Flex Query as XML.
  3. Import the XML into Portfolio Performance.
  4. Check the import preview.
  5. Observe that the reversed dividend has a negative number of shares but a positive dividend amount.
  6. Complete the import.
  7. Check the related cash account balance.
  8. The reversed dividend increases the balance instead of decreasing it.

Expected behavior

A dividend reversal should be imported with a negative cash amount or should reverse the original dividend transaction.

For this example, the resulting cash balance should be:

-0.70 USD + 0.76 USD - 0.06 USD = 0.00 USD

I have attached screenshots showing:

  • the import preview with the reversed dividend imported as +0.70 USD and -8 shares,
  • the resulting USD cash account balance of 1.40 USD.

Screenshots

Image Image
  • OS: Windows
  • Version: 0.86.1 (jul 2026)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions