From 2db9e021e32995d7bc42f76438366fa12c8a335d Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 30 Jun 2024 21:54:39 +0200 Subject: [PATCH] add FailToDeliver component --- src/lib/components/FailToDeliver.svelte | 394 ++++++++++++++++++++++ src/lib/store.ts | 1 + src/routes/stocks/[tickerID]/+page.svelte | 13 +- 3 files changed, 406 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/FailToDeliver.svelte diff --git a/src/lib/components/FailToDeliver.svelte b/src/lib/components/FailToDeliver.svelte new file mode 100644 index 00000000..abaf5fe0 --- /dev/null +++ b/src/lib/components/FailToDeliver.svelte @@ -0,0 +1,394 @@ + + + + + +
+
+ +
+ + +
+ + {#if data?.user?.tier === 'Pro'} + {#if isLoaded} + + {#if rawData?.length !== 0} + +
+
+ Over the past year, {$displayCompanyName} has seen a monthly average of + {abbreviateNumber(avgFailToDeliver)} fail to deliver shares. +
+
+ +
+ + + +
+ +
+
+ +
+ +
+
+ + + + Price + +
+
+ + + + Share Quantity + +
+ +
+ + +

+ Latest Information +

+ + +
+ + + + + + + + + + + + + + + +
+ Date + + {formatDateRange(rawData?.slice(-1)?.at(0)?.date)} +
+ Price Range + + $({lowestPrice+'-'+highestPrice}) +
+ Total failed deliveries + + {abbreviateNumber(totalFailToDeliver)} +
+
+ + + + {/if} + + {:else} +
+
+ +
+
+ {/if} + + {:else} +
+ + Unlock content with Pro Subscription +
+ {/if} + +
+
+ + + + + \ No newline at end of file diff --git a/src/lib/store.ts b/src/lib/store.ts index cdaef86f..b9715c4d 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -73,6 +73,7 @@ export const analystEstimateComponent = writable((false)); export const marketMakerComponent = writable((false)); export const optionComponent = writable((false)); export const clinicalTrialComponent = writable((false)); +export const failToDeliverComponent= writable((false)); export const strategyId = writable( ("")); diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 20b4be1c..8bd3e397 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -3,7 +3,7 @@ import {AreaSeries, Chart, PriceLine, CandlestickSeries} from 'svelte-lightweight-charts'; import { TrackingModeExitMode } from 'lightweight-charts'; - import {getCache, setCache, clinicalTrialComponent, optionComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; + import {getCache, setCache, clinicalTrialComponent, optionComponent, failToDeliverComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; import { onDestroy, onMount } from 'svelte'; import BullBearSay from '$lib/components/BullBearSay.svelte'; import CommunitySentiment from '$lib/components/CommunitySentiment.svelte'; @@ -1333,7 +1333,16 @@ function changeChartType() { - + + +
+ {#await import('$lib/components/FailToDeliver.svelte') then {default: Comp}} + + {/await} +
+
+ +
{#await import('$lib/components/MarketMaker.svelte') then {default: Comp}}