Skip to main content

Prices

Prices record what one commodity is worth in terms of another on a given date. You manage them on the Prices page. Widgets use those prices (and optionally costs from transactions) when converting amounts into the commodity you chose for a page or widget.

How-to

Add a price

  1. Open Prices.
  2. Choose Add Price.
  3. Set Date, Commodity, Price Amount, and Price Commodity.
  4. Optionally choose Add another price to enter more prices for the same date.
  5. Choose Add.

Price Commodity cannot be the same as Commodity.

Edit a price

  1. Open Prices.
  2. Select the price row you want to change.
  3. Update the fields in Edit Price.
  4. Choose Save.

Delete a price

  1. Open Prices.
  2. Select the price row.
  3. In Edit Price, choose Delete.
  4. Confirm the deletion.

Choose Price Evaluation Time on a widget

  1. Open the widget's settings (on a dashboard in Edit mode, when the widget allows settings).
  2. Find Pricing.
  3. Set Price Evaluation Time to one of:
    • As of each transaction's date
    • As of today
    • At the end of each period
    • Fixed date (then pick the date)
  4. Save the widget settings.

Turn Infer market prices on or off

  1. Open the widget's settings.
  2. Under Pricing, turn Infer market prices on or off.
  3. Save the widget settings.

When it is on, missing market prices may be filled in from costs recorded on transactions. When a market price and an inferred price fall on the same day, the market price from Prices takes precedence.

Reference

Prices page

  • Prices - Lists market prices grouped by date (newest dates first).
  • Add Price - Opens the dialog to add one or more prices for a date.
  • Each row shows 1 x the commodity, =, the price amount, and the price commodity. Selecting a row opens Edit Price.

Add / Edit Price fields

  • Date - The date this market price applies from.
  • Commodity - The unit being priced.
  • Price Amount - How many units of the price commodity equal one unit of the commodity.
  • Price Commodity - The unit the price is expressed in.

Meaning: 1 x Commodity = Price Amount Price Commodity.

In add mode you can use Add another price for more rows on the same date. Edit mode edits a single price and offers Delete.

Price Evaluation Time

Shown under widget Pricing as Price Evaluation Time:

OptionMeaning
As of each transaction's dateConvert each amount using the market price on that transaction's date.
As of todayConvert using the market prices in effect today (when the report is generated).
At the end of each periodConvert using the market price on the last day of the report period. For charts or reports with several subperiods, each subperiod uses its own end date.
Fixed dateConvert using the market price on the date you pick.

Conversion uses the latest price on or before that valuation date. Amounts with no usable price stay in their original commodity.

For the underlying valuation modes, see Valuation date and --value in the hledger manual.

Infer market prices

  • Infer market prices - Widget Pricing toggle. When on, costs from multicommodity transactions can supply market prices when no matching entry exists on Prices for that date.

See also --infer-market-prices in the hledger manual.

Transaction Cost fields

On a transaction posting, Cost records the exchange rate used in that transaction (what you paid or received), not a general market quote:

  • Type
    • No Cost - No cost on this posting.
    • Unit Cost - Price per one unit of the posting's commodity.
    • Total Cost - Total price for the whole posting amount.
  • Amount - The cost quantity (shown when a cost type other than No Cost is selected).
  • Commodity - The commodity the cost is in.

Amounts with a cost can show a cost hint (for example Unit Cost or Total Cost with the cost value).

For unit and total cost notation, see Costs in the hledger manual.

Explanation

Market prices and commodities

A commodity is the unit of an amount (a currency, shares, and so on). A market price answers: "On this date, what is one unit of commodity A worth in commodity B?"

Example: on 2026-03-01 you record that 1 x USD = 0.92 EUR. That does not move money between accounts. It only tells reports and widgets how to convert USD amounts into EUR when they need a single commodity.

You usually care about prices when you hold more than one commodity and want balances, net worth, or charts in one unit (often your default commodity).

How reports convert amounts using those prices is covered under Value reporting.

Market price vs transaction cost

These are related but not the same:

Market price (Prices)Transaction cost
What it isA dated quote: what one commodity is worth in anotherThe rate used on a specific posting when you exchange commodities
Where you set itPrices pageCost on a transaction posting
Typical useConvert holdings for reports and widgetsKeep the transaction balanced when two commodities change hands

Example: you buy 100 EUR and pay 108 USD.

  • On the EUR posting you might set Unit Cost to 1.08 USD (or Total Cost to 108 USD). That is what this purchase cost.
  • Separately on Prices, you might later record that EUR traded at 1.10 USD. Reports that value "as of today" can show the holding at the newer market rate, while the transaction still keeps the original cost.

For conversions that use equity accounts of category Conversion, see Commodities and Double-entry bookkeeping. For more on recording and reporting costs, see Costs and Cost reporting in the hledger manual.

Price Evaluation Time, with an example

Market prices change over time. Price Evaluation Time chooses which day's price is used when a widget converts amounts.

Suppose you hold 100 USD, and you recorded these prices (USD priced in EUR):

DatePrice
2026-01-011 x USD = 0.90 EUR
2026-02-151 x USD = 0.95 EUR
2026-03-011 x USD = 0.92 EUR

And you bought the 100 USD on 2026-01-10. Looking at that holding in EUR:

  • As of each transaction's date - Uses the price on 2026-01-10. The latest price on or before that day is 0.90, so about 90 EUR.
  • As of today - Uses today's latest price. If today is after 2026-03-01 and nothing newer exists, that is 0.92, so about 92 EUR.
  • At the end of each period - Uses the price on the last day of the selected period. If the period ends 2026-02-28, the latest price on or before that day is 0.95, so about 95 EUR. On a multiperiod chart, January and February each get their own period-end price.
  • Fixed date set to 2026-02-15 - Uses the price on that date: 0.95, so about 95 EUR.

Same holding, different evaluation times, different converted values. Pick the option that matches the question you are asking (historical rate at purchase, current value, period-end snapshot, or a specific day).

These map to hledger's valuation modes: then, end, now, and a fixed date. See also Finding market price and Valuation examples.

Infer market prices

Keeping every market price up to date by hand can be tedious. Infer market prices lets widgets treat costs on transactions as extra market prices when a suitable Prices entry is missing.

  • Useful when you often record the real exchange rate as Unit Cost or Total Cost on conversions.
  • Explicit prices on Prices still win on the same day.
  • If conversion still fails, add a price on Prices, or check that the cost commodity matches what the widget is converting to.

For more on commodities and the default commodity used on pages, see Commodities.