Understand the answer
Guides & conventions
Start with a small function, then learn the assumptions that make a result useful.
Assumptions and Conventions
TotalFinance does not hide finance conventions. Pro APIs return a `Computed<T>` envelope with `value`, `assumptions`, and `diagnostics`; facade APIs r
Backtesting
TotalFinance ships three simulation engines and one accounting law. Every engine emits the portfolio
Adopt TotalFinance without guessing why the numbers changed
Keep the old result, the new result, and their actual assumptions together. A close price is not
Command line
`@insiderfinance/totalfinance` ships the `totalfinance` binary (embedded API at `/cli`): the local, machine-first front door to the same operation
Compare reported holding partitions
Use `compareDisclosedHoldingPartitions` to compare common-stock disclosure lines while keeping
Compare reported holdings
`compareDisclosedHoldings` compares two supplied disclosure snapshots. It reports what changed in
First useful results and first-failure recovery
These synthetic examples use the public SDK and its existing operation registry. Install
End to end: fundamentals → valuation → screen → portfolio → backtest → performance
One journey across six packages, on committed numbers, with no provider, network, credential,
Results & the `.explain()` envelope
Every runtime operation in TotalFinance is exactly one of four roles, and each role has ONE result
Errors and Diagnostics
TotalFinance separates programmer/input failures from quantitative failures.
Local HTTP server
`@insiderfinance/totalfinance` ships `totalfinance-http` (embedded API at `/http`): a loopback, read-only-by-default HTTP server over the same
Imports and bundles
Use named imports from `@insiderfinance/totalfinance/<domain>` as the portable browser
Levels: raw, facade, analysis, artifact, batch, workflow
TotalFinance is one library at six levels, and no level is the only route. The same instrument — a
MCP Server
`@insiderfinance/totalfinance-mcp` exposes TotalFinance computations to AI agents through the Model Context Protocol. The server is read-only by defau
Convert futures/index levels to ETF levels
Start with a named helper when your pair is listed below. Supply the level to translate and
Calculate sector performance
Use `sectorPerformance` when you already have comparable returns for each security. Use
Compute only what you need: selective Greeks and exposure
A dashboard that charts gamma exposure needs gamma. It does not need option prices, theta or rho,
Strategy catalogue (`@insiderfinance/totalfinance/strategy`)
The strategy package builds an option **position** from legs and computes the full profit-calculator
TotalFinance indicator compatibility matrix
Cross-reference of TotalFinance canonical names against TA-Lib, pandas-ta and TradingView. Any name below resolves via `resolveIndicator` (case-insens
TotalFinance indicator registry
Auto-generated from `@insiderfinance/totalfinance/technical-analysis` — 335 registered indicators.
TotalFinance TA — the live tier (charting workflows)
The technical-analysis package (`@insiderfinance/totalfinance/technical-analysis`) is built for live, charting-product use, not just
Saving and restoring a streaming indicator
Every indicator in `@insiderfinance/totalfinance/technical-analysis` has a streaming form, and every streaming form is
TotalFinance indicator warmup / lookahead / displacement
Warmup is the number of leading bars before the first real value, measured at the canonical parameters shown (via `indicator.explain(...).diagnostics.
The safe trade lifecycle
TotalFinance gives an agent — coded, learned, or an LLM — one lifecycle through which a decision may
The trading-agent environment
TotalFinance ships a deterministic environment in which coded policies, learned policies, and LLM agents
Start small, keep the raw API
You do not need to construct a portfolio, register an operation, start a server, or connect a data provider to calculate an option price. Install one
Getting Started
TotalFinance is an unpublished preview. Until npm publication, use a
Stability tiers
TotalFinance `0.1.0` is **pre-1.0 software**, not a 1.0 stability guarantee. The main toolkit
Bundle size report
<!-- Generated by tools/bundle-size-doc.ts — do not edit by hand. Run `pnpm run bundle:update`. -->
Security policy
TotalFinance computes from the data you pass in. Compute entry points open no network connection and