From 1703e758d6ae859acea0c0679ee31f881d9b1a87 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 24 Sep 2024 18:50:29 +0200 Subject: [PATCH] add FOMC Impact Feature --- src/lib/components/FOMCImpact.svelte | 293 ++++++++++++++++++++++ src/lib/store.ts | 1 + src/routes/etf/[tickerID]/+page.svelte | 12 +- src/routes/stocks/[tickerID]/+page.svelte | 9 + 4 files changed, 313 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/FOMCImpact.svelte diff --git a/src/lib/components/FOMCImpact.svelte b/src/lib/components/FOMCImpact.svelte new file mode 100644 index 00000000..ccfa3bee --- /dev/null +++ b/src/lib/components/FOMCImpact.svelte @@ -0,0 +1,293 @@ + + + + + +
+
+ +
+ + +
+ + {#if isLoaded} + {#if Object?.keys(rawData)?.length !== 0} +
+ +
+
+ Examine how sensitive {$displayCompanyName}'s stock price is to the decisions made during FOMC meetings. The vertical line marks the interest rate decision. +
+
+ + + +
+ +
+ + +

+ Latest FED Interest Rate +

+ +
+ The latest list of previous, forecasted, and actual interest rate decisions made by the FED. +
+ The "% Price Change" column reflects the performance for each interval leading up to the next FOMC meeting. +
+ +
+ + + + + + + + + + + + {#each (showFullStats ? tableList?.slice(0,10) : tableList?.slice(0,3)) as item,index} + + + + + + + + + + + + + + + {/each} + +
DatePreviousForecastActual% Price Change
+ {new Date(item?.date ?? null)?.toLocaleString('en-US', { + month: 'short', + day: 'numeric', + year: 'numeric', + })} + + {item?.previous}% + + {item?.estimate}% + + {item?.actual}% + + {#if item?.changePercentage >=0} + +{item?.changePercentage?.toFixed(2)}% + {:else} + {item?.changePercentage?.toFixed(2)}% + {/if} +
+ + +
+ + + + + + +
+ + {:else} +

+ No data available + +

+ + {/if} + + {:else} +
+
+ +
+
+ {/if} + + + +
+
+ + + + + \ No newline at end of file diff --git a/src/lib/store.ts b/src/lib/store.ts index 404ed230..d6a5a405 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -101,6 +101,7 @@ export const taRatingComponent = writable(false); export const dcfComponent = writable(false); export const correlationComponent = writable(false); export const corporateLobbyingComponent = writable(false); +export const fomcImpactComponent = writable(false); export const strategyId = writable(""); export const articleId = writable(""); diff --git a/src/routes/etf/[tickerID]/+page.svelte b/src/routes/etf/[tickerID]/+page.svelte index 59df1e67..7de519f5 100644 --- a/src/routes/etf/[tickerID]/+page.svelte +++ b/src/routes/etf/[tickerID]/+page.svelte @@ -3,7 +3,7 @@ import {AreaSeries, Chart, PriceLine, CandlestickSeries} from 'svelte-lightweight-charts'; import { TrackingModeExitMode } from 'lightweight-charts'; - import {getCache, setCache, taRatingComponent, failToDeliverComponent, optionsNetFlowComponent, optionComponent, sentimentComponent, varComponent, retailVolumeComponent, trendAnalysisComponent, priceAnalysisComponent, assetType, screenWidth, globalForm, numberOfUnreadNotification, displayCompanyName, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, clientSideCache, etfTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; + import {getCache, setCache, taRatingComponent,fomcImpactComponent, failToDeliverComponent, optionsNetFlowComponent, optionComponent, sentimentComponent, varComponent, retailVolumeComponent, trendAnalysisComponent, priceAnalysisComponent, assetType, screenWidth, globalForm, numberOfUnreadNotification, displayCompanyName, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, clientSideCache, etfTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; import { onDestroy, onMount } from 'svelte'; import ETFKeyInformation from '$lib/components/ETFKeyInformation.svelte'; import Lazy from '$lib/components/Lazy.svelte'; @@ -1348,7 +1348,15 @@ async function exportData(timePeriod:string) { - + +
+ {#await import("$lib/components/FOMCImpact.svelte") then { default: Comp }} + + {/await} +
+
+ +
{#await import('$lib/components/PriceAnalysis.svelte') then {default: Comp}} diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 135877bb..bebf67c4 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -5,6 +5,7 @@ import { getCache, setCache, + fomcImpactComponent, corporateLobbyingComponent, taRatingComponent, swapComponent, @@ -1110,6 +1111,14 @@ async function exportData(timePeriod:string) {
+ +
+ {#await import("$lib/components/FOMCImpact.svelte") then { default: Comp }} + + {/await} +
+
+
{#await import("$lib/components/CorporateLobbying.svelte") then { default: Comp }}