Skip to content

Ledger ​

Ledger represents a book of financial transactions in an individual account or a group of accounts.

The app maintains a separate ledger per account with exception of migrated accounts. Transactions in accounts transferred between different branches of Interactive Brokers are automatically grouped together into a single ledger.

View trades chronologically ​

Run the following command to view chronological trade data as series of positions:

sh
portfelj ledger

View closing trades ​

List closing trades within the given year, with matching opening trades in the same or preceding year(s) based on FIFO order.

For example, let's list all closing trades in 2024:

sh
portfelj ledger --tax-year 2024

TIP

The data output of this mode is used for generation of tax returns for eDavki.

Search and filter output ​

It's possible to filter ledger output using either one or multiple filters:

  • By account ID

    For example only show trades in the account ID U7000001:

    sh
    portfelj ledger --account-id U7000001

    Replace U7000001 with the actual account ID

  • By symbol

    For example only show positions in APPL:

    sh
    portfelj ledger --symbol AAPL

Convert to euro ​

By default, positions in ledger are displayed in the currency of trade.

Run ledger with --euro flag to automatically convert all prices to Euro:

sh
portfelj ledger --tax-year 2024 --euro

Merge multiple accounts ​

By default, each account is treated separately and the output of ledger looks as series of accounts and positions.

One exception to that is when there is a link between accounts. For instance when the same account is moved between different branches of Interactive Brokers.

Run ledger with --merge flag, if you'd like to have a combined view of all accounts as a single ledger. For example:

sh
portfelj ledger --tax-year 2024 --merge

TIP

If you only have one account with IB then you should never need to provide this flag explicitly.

Get more help ​

Each sub-command has a built-in help. Just append --help to any command to view all available options:

sh
portfelj ledger --help