Equity

Some users like to keep ledger files for each year. To aid in creating a new starting balance for the next file, we can use the ledger equity command to generate the required transaction to have the correct starting balances.

Let's start 2022, using all transactions up to the end of 2021. As the end date on the command line is not included, we can use 2022/01/01 as the end date.

Run ledger -f ledger.dat equity -e "2022/01/01"

2021/12/31 Opening Balances
    Assets:Bank:Checking                                                 2178.00
    Assets:Cash:Wallet                                                    100.00
    Assets:Crypto:BTC                                                     300.00
    Assets:Crypto:ETH                                                     200.00
    Equity:Opening Balances                                             -1000.00
    Expenses:Food:Groceries                                               222.00
    Income:Salary                                                       -2000.00