> For the complete documentation index, see [llms.txt](https://docs.sterlinglabs.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sterlinglabs.co/portfolio/how-numbers-work.md).

# How the numbers are computed

Sterling's figures are built to be consistent with each other and with the market, which means they will not always match your broker's app to the cent. This page explains why, and what to do when something looks wrong.

## Why figures differ from your broker

* **Live pricing.** During the session, U.S. stocks and ETFs are marked from Sterling's one-minute market data. Your broker may show a delayed quote or a settlement price. The Positions table shows how fresh each price is when you hover over it.
* **Sync lag.** Broker changes arrive with a delay that depends on the broker: seconds for a paper account, minutes for some brokers, overnight for others. See [Connecting a brokerage](/portfolio/connecting-a-brokerage.md).
* **Separate reads.** Balances, positions, and account value come from separate broker reads and can be briefly out of step with each other.
* **Uncovered securities.** Over-the-counter names, foreign ordinaries, very new listings, and fixed income use the broker's own mark or are flagged as missing one.
* **Sweep funds.** Money-market sweep funds are folded into cash, so Sterling's cash figure can differ from the broker's home screen.
* **Maintenance.** Brokers have maintenance windows during which their figures do not update.

## Totals are all or nothing

Sterling does not publish a total when part of it is unknown. If one holding has neither a live price nor a broker mark, if the account holds cash in another currency, or if an option's contract size is unknown, the KPI tiles show dashes and the Positions header reads **Weight —** and **Cash —**. Hover over a dash for the reason. The rows that can be priced are still shown.

## Stock splits

The value and compare charts carry through a split smoothly. The Positions table and the KPI tiles depend on your broker updating the share count, which can take 24 to 48 hours after the ex-date. In that window a split-adjusted price against pre-split shares can show a large false loss, and cost basis and realized P\&L for that symbol are withheld until the broker catches up. The figures right themselves at the next sync after your broker updates.

## Options

Each option leg is its own row in Positions, at the figures your broker last reported; options are not priced live. Options are excluded from factor attribution and listed as uncovered in the Explainer. A leg whose contract size is unknown causes the totals to be withheld.

## Margin

A margin loan appears as negative cash. Sterling does not show a margin balance or margin requirement. **Gross exposure** above 100% means market exposure exceeds account value; it does not by itself mean you are borrowing.

## Cash

Two cash figures exist and can differ slightly. The KPI strip's figure comes from your broker's statement; the Positions header's figure is the synced account value less the value of positions. Cash held in currencies other than U.S. dollars appears as its own row and is not converted, and its presence causes totals and percentages to be withheld.

A cash-only account in U.S. dollars shows cash rows in Positions, a flat value chart at the cash balance, dashes in most tiles, and a cash summary in the Explainer. Cash held only in another currency appears as a row but draws no line and leaves the totals withheld.

## Sessions and timestamps

* The KPI tiles and all charts reflect the regular session only. After-hours prints do not move them.
* **Valuation price** in Positions shows the age of the one-minute bar behind it. On a quiet symbol the bar can be minutes or hours old.
* **Live P\&L** in the Trade Log shows when the lot was last marked, or that the figure is final for a closed lot.
* The page header's last-synced time is when your broker was last read.

## History

Value history and since-inception risk figures reach back to May 2018 at the earliest, and no earlier than the youngest holding that can be priced. A book that predates that shows history from where Sterling's data begins, not from the account's opening.

## Messages and what to do

| What you see                                                         | What it means                                        | What to do                                                                                                                                    |
| -------------------------------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Setup screen with a broker error                                     | The first sync failed.                               | If the message says Sterling will retry, wait. Otherwise select refresh in the header, or reconnect the brokerage if the message asks you to. |
| **Partial** badge and "Some accounts didn't sync"                    | One brokerage's accounts did not sync; the rest did. | Select **Try again**. If it persists, disconnect and reconnect that brokerage.                                                                |
| "Your last refresh didn't complete — you can try again in N seconds" | Sterling accepts one manual refresh a minute.        | Wait for the countdown.                                                                                                                       |
| "Finishing your last sync…" in the disconnect dialog                 | A sync is still running.                             | Wait; the dialog retries on its own for about a minute.                                                                                       |
| "Couldn't disconnect. Please try again."                             | The disconnect did not go through.                   | Try again.                                                                                                                                    |
| "Valuation price unavailable"                                        | No live price for this holding.                      | Nothing; the row uses your broker's figures.                                                                                                  |
| "Cash can't be charted as a position"                                | You selected a cash row for the positions chart.     | Select a security instead.                                                                                                                    |
| "Not enough chart observations for this range yet"                   | Too few points in the window.                        | Choose a longer range or check back after the next update.                                                                                    |
| "Couldn't load your holdings"                                        | The trades chart could not load lots.                | Select **Retry**.                                                                                                                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sterlinglabs.co/portfolio/how-numbers-work.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
