Skip to content

feat(fundamental): add MacrodataIndicators and Macrodata methods#98

Merged
hogan-yuan merged 9 commits into
mainfrom
feat/economic-indicator
Jun 10, 2026
Merged

feat(fundamental): add MacrodataIndicators and Macrodata methods#98
hogan-yuan merged 9 commits into
mainfrom
feat/economic-indicator

Conversation

@hogan-yuan

@hogan-yuan hogan-yuan commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Two new methods on FundamentalContext:

  • MacrodataIndicators(ctx, offset, limit)GET /v1/quote/macrodata — list all macroeconomic indicators (~619 total)
  • Macrodata(ctx, indicatorCode, startDate, endDate, limit)GET /v1/quote/macrodata/{indicator_code} — fetch historical data for one indicator

startDate / endDate accept "YYYY-MM-DD" strings and are sent to the API as YYYY-MM-DDT00:00:00Z / YYYY-MM-DDT23:59:59Z.

New Types

Type Description
MultiLanguageText Localized text (English / Simplified Chinese / Traditional Chinese)
MacrodataIndicator Indicator metadata (code, country, category, periodicity, importance, etc.)
Macrodata One historical data point (period, actual/previous/forecast/revised values, release timestamps, unit)
MacrodataResponse Info MacrodataIndicator + Data []Macrodata

Time field formats

All timestamp fields (StartDate, ReleaseAt, NextReleaseAt) are returned as *time.Time (UTC) — consistent with other SDK methods.

Related

hogan-yuan and others added 9 commits June 9, 2026 19:31
…thods

Two new methods on FundamentalContext:
- EconomicIndicatorList: GET /v1/quote/macrodata (list all ~619 indicators)
- EconomicIndicator: GET /v1/quote/macrodata/{indicator_code} (historical data)

New types: MultiLanguageText, EconomicIndicatorInfo, EconomicIndicatorData,
EconomicIndicatorResponse.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- StartDate: string -> *time.Time
- ReleaseAt/NextReleaseAt: string -> *time.Time (optional)
Use parseOptionalTimestamp helper (returns nil for zero/empty values).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…List/Macrodata

Method names now match the API path /v1/quote/macrodata.
Type names (EconomicIndicatorInfo, EconomicIndicatorData, etc.) unchanged.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Input params now accept time.Time and are serialized as RFC3339
(2024-01-01T00:00:00Z) to match API requirements.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
start_date -> start_time: YYYY-MM-DDT00:00:00Z
end_date   -> end_time:   YYYY-MM-DDT23:59:59Z

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
EconomicIndicatorInfo -> MacrodataIndicatorInfo
EconomicIndicatorData -> MacrodataRecord
EconomicIndicatorResponse -> MacrodataResponse

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
MacrodataIndicatorInfo -> MacrodataIndicator
MacrodataRecord -> Macrodata

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- EconomicIndicatorListResponse: json:"data" -> json:"list" (actual API field)
- start_date/release_at/next_release_at: parse as RFC3339 string not unix seconds

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@hogan-yuan hogan-yuan changed the title feat(fundamental): add EconomicIndicatorList and EconomicIndicator feat(fundamental): add MacrodataIndicators and Macrodata methods Jun 10, 2026
@hogan-yuan hogan-yuan merged commit d8f6559 into main Jun 10, 2026
@hogan-yuan hogan-yuan deleted the feat/economic-indicator branch June 10, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant