Skip to content

Forecasting

forecast_balance projects the balance of your accounts month by month, up to 24 months ahead. It separates what recurs, placed on its day, from what varies, spread over the days, and returns every assumption.

The accounts are those given in account_ids, or else every open on-budget account. The starting balance is the sum of their balances today; the history is their transactions, without transfers or deleted ones.

Over the last 4 full months (the current month is incomplete and left out), transactions are grouped by normalised payee and direction. A group recurs when:

  • it appears in at least 3 of the 4 months, and
  • each month’s total is within 20 % of the median monthly total.

It is then projected every month for its median monthly amount, on the median day it fell on (the last day of a shorter month when needed).

The scheduled transactions of the projected accounts, from tomorrow to the end of the horizon, fall on their dates, repeated at their YNAB frequency — a yearly insurance included. A payee with a schedule is projected by it alone: it leaves the recurring charges and the averages, so it is never counted twice. A transfer between two projected accounts is left out, since it changes neither total; a transfer to another account counts as money out. They are returned in assumptions.scheduled.

Assumption Default Override
Other spending the average of the last 3 full months’ outflows, recurring charges excluded variable_monthly
Income the average of the last 3 full months’ inflows, recurring income excluded monthly_income
One-off amounts none one_offs: {date, amount, label}

When you give monthly_income, it replaces the income found in the history and the scheduled inflows, salary included, so a salary is never counted twice.

Month by month, day by day from tomorrow:

  • Recurring amounts fall on their day; in the current month, only those still to come.
  • Other spending and income are spread evenly over the days left, in whole cents. For the current month, what was already spent or received since the 1st (outside recurring payees) is deducted from the monthly averages: only what is left is projected.
  • Scheduled transactions and one-off amounts fall on their date, if it is after today and within the horizon.

For each month the answer gives start, inflows, outflows, end and lowest, the lowest balance of any day in the month. first_shortfall is the first month whose lowest is below zero.

The horizon until is a month, YYYY-MM, from the current month to 24 months ahead.

Unofficial project. We are not affiliated, associated, or in any way officially connected with YNAB or any of its subsidiaries or affiliates. YNAB and You Need A Budget are registered trademarks of YNAB. avenir-mcp is provided as is, without warranty, and is not financial advice. Legal notice