Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Asserts

An assertion is a condition that must hold true on certain days. If the condition evaluates to false the simulation stops and reports the failure. Assertions are how you express financial constraints and goals.

Syntax

assert [<schedule>] that <boolean-expression>

Without a schedule, an assertion is checked every day of the simulation. With a schedule, it is checked only on days that match.

Daily assertions

assert that Assets:Cash >= 0
assert that jim_paycheck.retirement_contribution.ytd <= 24_500

These fire every day. The first ensures the cash account never goes negative. The second ensures a named leg never exceeds a limit.

Scheduled assertions

Any schedule expression can precede the condition:

assert quarterly that Assets:Retirement >= 0
assert monthly on the last day that Assets:Cash >= 10_000
assert every friday that Liabilities:AccruedInterest >= 0

Date-specific assertions

A single date (or a list of dates) acts as a schedule:

assert 2026-12-31 that Assets:Retirement:Seb  == 24_500
assert 2026-12-31 that Assets:Retirement:Jess == 24_500

Expressions

Assertion expressions support the same operators as entry amounts:

OperatorMeaning
<, <=Less than, at most
>, >=Greater than, at least
==, !=Equal, not equal
and, or, notCombine conditions (not binds tightest, then and, then or)
if … then … else …Conditional (both then and else are required)
min(), max()Built-in functions

Account references, param names, and aggregation suffixes (.ytd, .qtd, .mtd) all work inside assertion expressions.

Comparisons can’t be chained: write 0 <= x and x <= 100, not 0 <= x <= 100. The right side of and and or is only evaluated when needed.

Examples

// Cash never goes negative
assert that Assets:Cash >= 0

// 401(k) contribution limit not breached
assert that jim_paycheck.retirement_contribution.ytd <= max_401k

// Target retirement balance hit by a specific date
assert 2026-12-31 that Assets:Retirement:Beth == 24_500

// Cash stays within a band
assert that Assets:Cash >= 1_000 and Assets:Cash <= 50_000

// Sanity-check every quarter
assert quarterly that Assets:Retirement:Seb >= 0