From 6debdaf00ad35497d3d0e443deeb0aa313cc1e43 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Mon, 4 Nov 2024 21:14:12 +0100 Subject: [PATCH] add fed fund rate plot --- src/routes/+layout.svelte | 16 ++ src/routes/economic-indicator/+page.server.ts | 2 - src/routes/economic-indicator/+page.svelte | 240 ++++++++++++------ src/routes/stocks/[tickerID]/+page.svelte | 7 +- 4 files changed, 176 insertions(+), 89 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 4b35dfce..bbc40fdc 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -542,6 +542,17 @@ const handleTwitchMessage = (event) => { >Economic Calendar + -
-
-

- Economic Indicators -

-
- - - The indicators measure economic performance and identify - growth trends. - -
- - - - - - +
+

+ Economic Indicators +

{#if isLoaded} -
-

+
+ + We provide real-time and historical data on key economic indicators + like GDP, unemployment, and inflation, essential for tracking economic + performance and growth trends. +
+ +
+

+ Federal Fund Rate +

+ +
+ The federal funds rate is the interest rate at which banks lend + to each other overnight to maintain reserve balances. It's a + critical tool for U.S. monetary policy, influencing borrowing + costs for consumers and businesses, economic growth, and + inflation. Changes in the federal funds rate affect everything + from loan interest rates to stock market performance, making it + a key indicator of economic health. +
+ + +
+ +
+
+ +

Consumer Price Index (CPI)

@@ -648,7 +710,9 @@
-

+

Gross Domestic Product (GDP)

@@ -666,7 +730,9 @@
-

+

Unemployment Rate vs Inflation Rate

@@ -686,7 +752,9 @@ -

+

Treasury Rates

@@ -917,10 +985,10 @@ diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index b304482d..bc5c9572 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -619,23 +619,24 @@ exportList = await response.json(); exportList = exportList?.map( - ({ time, open, high, low, close, date }) => ({ + ({ time, open, high, low, close, date, volume }) => ({ date: timePeriod === "max" ? time : date, // Use 'time' if timePeriod is "max", otherwise use 'date' open, high, low, close, + volume }), ); const csvRows = []; // Add headers row - csvRows.push("time,open,high,low,close"); + csvRows.push("time,open,high,low,close, volume"); // Add data rows for (const row of exportList) { - const csvRow = `${row.date},${row.open},${row.high},${row.low},${row.close}`; + const csvRow = `${row.date},${row.open},${row.high},${row.low},${row.close},${row.volume}`; csvRows.push(csvRow); }