Metadata-Version: 2.4
Name: openbb-tradingagent
Version: 1.0.0
Summary: Point-in-time company fundamentals from tradingagentapp.com for the OpenBB Platform (US SEC EDGAR, Taiwan TWSE, Korea OpenDART).
License: MIT
Keywords: openbb,fundamentals,point-in-time,edgar,twse,opendart
Author: Trading Agent
Author-email: tradingagentapp@gmail.com
Requires-Python: >=3.10,<4
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: openbb-core (>=1.6.10,<2.0.0)
Project-URL: Homepage, https://www.tradingagentapp.com/fundamentals
Project-URL: Repository, https://github.com/Wei-LienWU/trading-agent
Description-Content-Type: text/markdown

# Trading Agent provider for OpenBB

Point-in-time, **as-first-reported** company fundamentals from official regulator
filings — inside the OpenBB Platform.

| Market | Source | Coverage |
| --- | --- | --- |
| United States | SEC EDGAR (XBRL) | ~7,000 filers, annual + quarterly, FY2014→ |
| Taiwan | Taiwan Stock Exchange OpenAPI | every listed company |
| Korea | FSS OpenDART | loading (full market) |

Every value is keyed by the **official filing date it became public on**, and
queries accept an `as_of` knowledge date — so a backtest at date *T* sees only
what was public at *T*. No restatement look-ahead.

## Install

```bash
pip install openbb-tradingagent
openbb-build   # regenerate the static assets so the provider appears
```

## Use

The provider attaches to OpenBB's existing fundamentals commands:

```python
from openbb import obb

# No key needed — the demo tier covers 25 flagship tickers at full fidelity.
obb.equity.fundamental.latest_attributes(
    symbol="2330.TW", tag="revenue,net_income", provider="tradingagent"
)

# Point-in-time: what did AAPL's reported revenue history look like on 2022-01-01?
obb.equity.fundamental.historical_attributes(
    symbol="AAPL", tag="revenue", provider="tradingagent", as_of="2022-01-01"
)
```

Set a key for the full universe:

```python
obb.user.credentials.tradingagent_api_key = "ta_live_…"
```

or in `~/.openbb_platform/user_settings.json`:

```json
{ "credentials": { "tradingagent_api_key": "ta_live_…" } }
```

Without a key the provider falls back to the public `demo` key: 25 flagship
tickers (US, Taiwan, Korea), full history, all fields, no signup. Paid plans
unlock every ticker — your code does not change.

## The `as_of` parameter

This is the reason the provider exists. Most fundamentals APIs serve *today's*
restated figures against *historical* dates, which quietly leaks future
information into a backtest. Here, `as_of` filters to `filed <= as_of`:

```python
# FY2021 as it was actually reported, not as later amended
obb.equity.fundamental.latest_attributes(
    symbol="AAPL", tag="revenue", provider="tradingagent", as_of="2022-01-01"
)
```

## Fields

`historical_attributes` returns, per row: `date` (period end), `symbol`, `tag`,
`value`, `unit`, `fiscal_year`, `fiscal_period`, `filed`, `form`, `market`,
`issuer_id`.

Available tags include `revenue`, `net_income`, `assets`, `liabilities`,
`equity`, `cash`, `gross_profit`, `operating_income`, `long_term_debt`,
`rnd_expense`, `eps_diluted`, `shares_diluted`, plus derived ratios
`net_margin`, `gross_margin`, `operating_margin`, `roe`, `roa`,
`debt_to_equity`, `asset_turnover`.

## Data notes

- **Taiwan income-statement figures are cumulative year-to-date** (Taiwan
  reporting convention): Q2 is the H1 total, Q4 the full year. Difference
  adjacent quarters for single-quarter flows. Balance-sheet items are
  point-in-time as usual.
- Values are as filed. Filers make mistakes; we do not silently correct them.

## Sources and licences

- **US** — SEC EDGAR, public domain.
- **Taiwan** — Taiwan Stock Exchange, under the Open Government Data License 1.0.
  The attribution is embedded in every API response and must be preserved.
- **Korea** — FSS OpenDART. Public data; the FSS confirmed in writing that no
  separate approval agreement is required for commercial use.

Factual historical data only — not investment advice, not a recommendation.

Full API documentation: <https://www.tradingagentapp.com/developers>
Pricing and licences: <https://www.tradingagentapp.com/fundamentals>

MIT licensed. Operated by WU Capital Limited, Auckland, New Zealand.

