TTM Net Income from Financial Data APIs: Calculate It, Reconcile It, Check When It Was Available

TickDB Research ·

Summary: A correct trailing twelve-month calculation can still be the wrong input for a research model. Use Cambricon's actual filings and a saved financial data API response to align reporting periods, distinguish parent-attributable from consolidated net income, and separate the reporting date from information availability. Includes a worked reconciliation, runnable Python, a checklist, and two explanatory figures.

A quarterly filing arrives. Your spreadsheet now contains last year's annual earnings, this year's year-to-date earnings, and a TTM figure from a financial data API. Which one belongs in the “last twelve months” column—and could you have used it at an earlier research date?

For Cambricon, parent-attributable net income was about CNY 2.059 billion in 2025 and CNY 3.715 billion in the first nine months of 2026. Neither figure alone covers the twelve months ending September 30, 2026. Combining compatible inputs produces CNY 4.169 billion. Checking when that information became available is a separate step.

This example follows those three questions in order: which months, whose profit, and known when. Cambricon (688256.SH) is a China A-share company. All amounts are in Chinese yuan, or CNY; no currency conversion is involved. The English labels below explain the corresponding lines in its Chinese filings.

1. Build the twelve-month window before applying the formula

For a period ending September 30, 2026, TTM covers October 1, 2025, through September 30, 2026:

Q4 2025 + Q1–Q3 2026 = 12 consecutive months

Remove January–September from full-year 2025, keep Q4, and add January–September 2026 to build a twelve-month window

Figure 1. Each block represents one month. Orange marks the prior year's fourth quarter; teal marks the current year's first nine months.

The current filing already provides the nine-month total. The missing piece is the previous year's fourth quarter. Recover it by subtracting that year's first nine months from its annual result:

Prior Q4 = Prior full year − Prior-year comparable YTD
TTM = Prior Q4 + Current YTD
    = Prior full year + Current YTD − Prior-year comparable YTD

The subtraction removes older months that no longer belong in the window. It is not removing an overlap between two different calendar years. Adding the current YTD then rolls the window forward.

For this case, all three inputs are net income attributable to owners of the parent, taken from the consolidated income statements:

InputCovered periodParent-attributable net income, CNY
Prior full yearJanuary–December 20252,059,228,538.67
Current YTDJanuary–September 20263,714,522,759.80
Prior-year comparable YTDJanuary–September 20251,604,645,744.11

Two filings supply the three figures. The 2025 annual report provides the first on page 103. Page 10 of the 2026 third-quarter report provides the current and comparative nine-month amounts.

Q4 2025:
2,059,228,538.67 − 1,604,645,744.11 = 454,582,794.56 CNY

TTM through September 2026:
454,582,794.56 + 3,714,522,759.80 = 4,169,105,554.36 CNY

That is approximately CNY 4.1691 billion. Keep the original amounts for the calculation and round only for presentation.

Read column headings rather than relying on a “Q3” label. A third-quarter filing may contain both July–September results and January–September cumulative results. This formula needs the latter. Multiplying nine-month earnings by 4/3 would extrapolate a fourth quarter; TTM instead uses four quarters that have already occurred. For companies with a different fiscal calendar, align the inputs to that calendar rather than copying these dates.

2. Keep the profit-attribution basis consistent

Total consolidated net income includes earnings or losses attributable to non-controlling interests. Parent-attributable net income allocates the group's result to owners of the parent. They are related measures, but they are not interchangeable inputs.

Cambricon's January–September 2026 consolidated net income equals parent-attributable net income plus a loss attributable to non-controlling interests

Figure 2. A loss attributable to non-controlling interests makes parent-attributable income larger than total consolidated income in this example. All values are CNY.

For January–September 2026, the statement gives:

Consolidated net income = Parent-attributable net income + NCI profit/(loss)
3,714,299,743.36         = 3,714,522,759.80               + (−223,016.44)

Calculating TTM consistently on each basis produces two different results:

Basis used for all three inputsTTM net income, CNY
Parent-attributable net income4,169,105,554.36
Total consolidated net income4,168,749,076.59

Choose the measure appropriate to the research question and preserve it across the annual, current YTD, and comparative YTD inputs. Also align currency, units, consolidation scope, and any restated comparative figures.

“Net income attributable to owners of the parent” is not the same as net income in a parent-only income statement. The first describes ownership attribution within the consolidated group; the second describes a different reporting entity. Similar wording does not make the figures equivalent.

3. Separate the reporting period from information availability

Earnings for a period ending September 30 are not automatically information you could have known at the September 30 close. A current research update needs the reporting period. A historical screen or backtest also needs the version available at its decision time.

The dates in this case answer different questions:

ItemRecorded valueMeaning
Filing period end2026-09-30The end of the accounting period
Official PDF path date2026-10-24The date in the cited Q3 document's archive path
API snapshot date2026-11-15When the responses used here were requested and saved
Verified first availability timestampNot establishedWhen this version first became usable for the historical research task

The archive-path date does not establish an exact first-release time. Do not fill in midnight by default. The API retrieval date also does not establish what that API or another channel would have delivered earlier.

For a point-in-time study, verify the relevant release timestamp, the version actually available, and—where the workflow requires it—the time it reached the data channel. A later revision should not silently replace the version used for an earlier decision.

This example has not established those historical timestamps and versions. The code therefore leaves first availability as None and reports the historical input as unverified. If a verified timestamp is supplied later, passing the time comparison still does not validate the historical version or accounting basis. The function is a small safeguard, not a complete point-in-time data system.

4. Reconcile the API amount with the filings

The saved sample comes from TickDB MCP financial calls made on November 15, 2026. The annual, quarterly, and TTM income-statement requests all returned successfully:

ToolUse in this case
get_financials_annualInspect year-end records and their period labels
get_financials_latestRetrieve quarterly records for an internal four-quarter sum
get_financials_ttmObtain the API TTM amount for a filing-based comparison

The returned field is NetProfit, displayed as “net profit.” The label alone does not establish whether it represents consolidated or parent-attributable income.

Reconciliation itemAmount, CNY
Filing-based parent-attributable TTM4,169,105,554.36
Filing-based consolidated TTM4,168,749,076.59
API NetProfit TTM4,169,105,555
API minus parent-attributable result0.64
API minus consolidated result356,478.41

In this sample, the amount aligns closely with the parent-attributable result. The cause of the CNY 0.64 residual is unresolved; it has not been attributed to rounding. One company does not establish a universal definition of NetProfit.

The annual-tool response also contained a 2025 row of CNY 454,582,797 marked Q4/q4. It is close to the filing-derived fourth-quarter amount, rather than the full-year total of CNY 2,059,228,538.67. Substituting that row as the annual input would produce:

454,582,797 + 3,714,522,759.80 − 1,604,645,744.11
= 2,564,459,812.69 CNY

That is about CNY 1.605 billion below the correct filing-based parent-attributable result. It is a deliberately incorrect input example, not the TTM amount returned by the API. Read the period metadata alongside the tool name.

The API's raw TTM period_end is 2026-09-29, one day earlier than the official reporting period end. The reason remains unresolved. Preserve it as a separate raw value; it is not a verified disclosure date.

The four standalone API quarters sum to its TTM value. This checks internal consistency. The filings provide the separate reconciliation source; this exercise did not independently reconcile every API quarter against a separate quarterly filing.

TickDB's A-share data API supplied the structured financial records used through MCP in this example. Keeping their raw fields, amounts, and period labels lets a researcher connect retrieval to a reproducible calculation, while the company filings establish the accounting basis. Historical availability remains a separate requirement.

5. Reproduce the calculation and availability check in Python

Save the following as ttm_reconcile_en.py and run python3 ttm_reconcile_en.py. It uses the Python 3 standard library only: no key, packages, external files, or network connection are required.

The embedded inputs replay the filings and November 15 API snapshot. The script does not retrieve new financials or execute trades. October 1 in the check is an illustrative research cutoff, not a claimed release time or trading signal.

"""Offline TTM reconciliation. Python 3 standard library only.
Cambricon, 688256.SH; original amounts in CNY, not USD.
Filings: 2025 annual report p103; 2026 Q3 report pp9-10.
API inputs replay the November 15, 2026 snapshot. No network or trading.
"""
from decimal import Decimal as D
from datetime import datetime


def ttm(annual, current_ytd, prior_ytd):
    return D(annual) + D(current_ytd) - D(prior_ytd)


parent = ttm("2059228538.67", "3714522759.80", "1604645744.11")
total = ttm("2058487389.36", "3714299743.36", "1604038056.13")
api_ttm = D("4169105555")
quarters = ["454582797", "1013213582", "1297698503", "1403610673"]
api_quarter_sum = sum((D(x) for x in quarters), D("0"))

# These dates answer different questions. Do not substitute one for another.
report_period_end = "2026-09-30"
archive_path_date = "2026-10-24"  # PDF path date, not a verified release timestamp
api_snapshot_date = "2026-11-15"
raw_api_period_end = "2026-09-29"  # Preserve the original; cause unresolved
verified_available_at = None     # Unknown: do not invent a midnight timestamp


def availability_at(cutoff, available_at):
    if available_at is None:
        return "UNVERIFIED: first availability unknown; exclude from verified historical inputs"
    c = datetime.fromisoformat(cutoff)
    a = datetime.fromisoformat(available_at)
    if c.utcoffset() is None or a.utcoffset() is None:
        raise ValueError("Both timestamps must include a time zone")
    if a > c:
        return "UNAVAILABLE: later than the research cutoff"
    return "Time check passed; still verify the historical version and accounting basis"


print(f"Parent-attributable TTM net income: {parent:,.2f} CNY")
print(f"Consolidated TTM net income: {total:,.2f} CNY")
print(f"API NetProfit TTM: {api_ttm:,.2f} CNY")
print(f"API minus parent-attributable TTM: {api_ttm-parent:,.2f} CNY")
print(f"API minus consolidated TTM: {api_ttm-total:,.2f} CNY")
print(f"Sum of four API quarters: {api_quarter_sum:,.2f} CNY")
print(f"API TTM minus four-quarter sum: {api_ttm-api_quarter_sum:,.2f} CNY")
print("Filing period end:", report_period_end)
print("Official PDF path date:", archive_path_date)
print("API snapshot date:", api_snapshot_date)
print("Raw API period_end:", raw_api_period_end)
# Illustrative research cutoff, not an actual release time or a trading signal.
print("Historical availability check:", availability_at(
    "2026-10-01T09:30:00+08:00", verified_available_at))

Actual output from this script:

Parent-attributable TTM net income: 4,169,105,554.36 CNY
Consolidated TTM net income: 4,168,749,076.59 CNY
API NetProfit TTM: 4,169,105,555.00 CNY
API minus parent-attributable TTM: 0.64 CNY
API minus consolidated TTM: 356,478.41 CNY
Sum of four API quarters: 4,169,105,555.00 CNY
API TTM minus four-quarter sum: 0.00 CNY
Filing period end: 2026-09-30
Official PDF path date: 2026-10-24
API snapshot date: 2026-11-15
Raw API period_end: 2026-09-29
Historical availability check: UNVERIFIED: first availability unknown; exclude from verified historical inputs

When adapting the example, replace all filing inputs, API values, period labels, and availability records for the new company and window. Fill in first availability only when verified. This is a local reconciliation example, not a tested strategy for a trading or backtesting platform.

6. Keep a reconciliation record for the next update

CheckRecord for this case
Company and statementCambricon, 688256.SH; consolidated income statement
Primary measureParent-attributable net income for all three inputs
Currency and unitCNY; original yuan amounts with decimals
Input periodsFY2025; Jan–Sep 2026; Jan–Sep 2025
Filing locationsAnnual report p. 103; Q3 report pp. 9–10
TTM window and result2025-10-01 through 2026-09-30; CNY 4,169,105,554.36
API field and resultNetProfit; CNY 4,169,105,555
Reconciliation differenceAPI is CNY 0.64 above the parent-attributable result
Raw API dateperiod_end=2026-09-29; retain separately
Availability evidenceArchive path and snapshot date recorded; exact first availability unverified
Open itemsGeneral field definition, residual and date-label causes, historical availability and versions

At the next filing, remove the months that have left the window, add the new cumulative period, and keep the accounting basis consistent. Before using the result in a historical study, ask whether that version was actually available then.

This single-company example explains and reconciles a calculation; it does not estimate market-wide API accuracy or identify a trading pattern. TTM describes reported earnings for a trailing period, not a forecast. The same addition and subtraction should not be mechanically applied to balance-sheet balances, margins, or per-share measures.

Sources: Cambricon's 2025 Annual Report, consolidated income statement p. 103 (audited); 2026 Third-Quarter Report, consolidated income statement pp. 9–10 (unaudited); the official PDF archive paths; TickDB MCP financial responses collected on November 15, 2026. English financial labels are explanatory translations of Chinese filing lines. No new market-data request was made for this English edition.

Related articles

Trailing P/E (TTM): Financial Data API Guide to Adjusted Earnings and Peer Valuation

How do you calculate trailing P/E (TTM) for peer valuation without mixing earnings definitions? This financial data API research example combines dated market prices with official Cambricon and Hygon reports to compare reported and adjusted earnings—specifically, parent-attributable income excluding the reports' non-recurring items. The relative reference-multiple gap narrows from 10.33% to 6.34%. Includes a revenue-to-shareholder-earnings decomposition, an earnings sensitivity table and runnable Python.

TickDB Research ·

Choosing a Gold Price API: Is International Gold Enough for a Gold ETF Tool?

A gold ETF page needs more than an international gold quote. Using actual 518880.SH and XAUUSD responses alongside exchange and fund-manager information, this article separates ETF trade prices, international gold references and fund NAV, and provides a product-input checklist plus a reproducible holding-value calculation.

TickDB Research ·

Choosing a Hong Kong Stock Quote API: What Changes When a Script Moves to a Server?

Moving a personal Hong Kong stock script to a team server requires more than comparing API prices. Using Futu OpenD's official operating conditions and one actual Tencent quote response, this article separates gateway maintenance, login, quote entitlements, data timestamps and intended use into a practical trial checklist.

TickDB Research ·

Choosing a US Historical Stock Data API: When Does a Backtest Need Minute Bars?

Historical data should match the information a backtest needs. Using AAPL daily data and 390 one-minute records from the same day, this article checks the order of two price-threshold observations, explains when daily bars can be sufficient, and shows how an unresolved volume discrepancy changes a data trial.

TickDB Research ·

TradingView Chart Time Looks Wrong? Check the Timestamp Before the Feed

If a chart label disagrees with an API candle or a Pine label, start with one completed intraday bar. Compare the same open or close boundary in Unix milliseconds before deciding whether the mismatch comes from display formatting, timestamp units, session settings, or a different trading-day label.

TickDB Research ·