mirror of
https://github.com/caty21/forex-dashboard.git
synced 2026-08-17 14:38:05 +00:00
Fix macro indicators: add working retail sales and employment FRED series
Retail Sales: switch all currencies to *SLRTTO01GPSAM format (OECD monthly, already in MoM%) — covers USD, EUR(DEU proxy), GBP, JPY, CHF, CAD. Remove retailSales from PCT_FIELDS since values are already percentages. Employment: add LFEMTTTT*647S series (monthly levels → MoM%) for JPY, CAD, AUD and quarterly for NZD. These replace null/non-existent FRED series. PMI stays ⚠ — no free real-time source found. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
abf04aabbd
commit
3fcb72a25e
@@ -127,9 +127,10 @@ export async function GET(req: NextRequest) {
|
||||
if (!key) return NextResponse.json({ error: "FRED_API_KEY missing" }, { status: 500 });
|
||||
|
||||
// Fields and which need period-over-period % conversion
|
||||
// policyRate / unemployment → already in % → toIndicator
|
||||
// cpiCore / gdp / retailSales / employment → index/level → toIndicatorPct (MoM% or QoQ%)
|
||||
const PCT_FIELDS = new Set(["cpiCore", "gdp", "retailSales", "employment"]);
|
||||
// policyRate / unemployment / retailSales → already in % → toIndicator
|
||||
// (retailSales uses *SLRTTO01GPSAM series which report MoM% directly)
|
||||
// cpiCore / gdp / employment → index/level → toIndicatorPct (MoM% or QoQ%)
|
||||
const PCT_FIELDS = new Set(["cpiCore", "gdp", "employment"]);
|
||||
|
||||
const fieldMap: Record<string, string | null> = {
|
||||
policyRate: series.policyRate,
|
||||
|
||||
Reference in New Issue
Block a user