From 70ad457ac14ffd203b89673d70e5ee10789e07fd Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 7 Mar 2025 14:55:49 +0100 Subject: [PATCH] add dp impact feature --- .../DarkPool/HistoricalVolume.svelte | 2 +- src/lib/components/DarkPool/PriceLevel.svelte | 80 ++++--- .../components/DarkPool/RealtimeTrade.svelte | 206 ++++++++++++++++++ src/lib/components/FailToDeliver.svelte | 2 +- .../Options/HottestContracts.svelte | 2 +- .../Options/OpenInterestByExpiry.svelte | 2 +- .../Options/OpenInterestByStrike.svelte | 2 +- .../components/Options/UnusualActivity.svelte | 44 ++-- src/lib/components/Options/Volatility.svelte | 2 +- src/lib/components/RatingsChart.svelte | 2 +- .../etf/[tickerID]/dark-pool/+page.svelte | 1 + .../stocks/[tickerID]/dark-pool/+page.svelte | 1 + .../[tickerID]/metrics/[slug]/+page.svelte | 2 +- .../[tickerID]/profile/employees/+page.svelte | 2 +- 14 files changed, 283 insertions(+), 67 deletions(-) create mode 100644 src/lib/components/DarkPool/RealtimeTrade.svelte diff --git a/src/lib/components/DarkPool/HistoricalVolume.svelte b/src/lib/components/DarkPool/HistoricalVolume.svelte index edcaf769..5575efad 100644 --- a/src/lib/components/DarkPool/HistoricalVolume.svelte +++ b/src/lib/components/DarkPool/HistoricalVolume.svelte @@ -82,7 +82,7 @@ animation: false, }, title: { - text: `

${removeCompanyStrings($displayCompanyName)} Historical Chart

`, + text: `

${removeCompanyStrings($displayCompanyName)} Historical Chart

`, style: { color: "white", }, diff --git a/src/lib/components/DarkPool/PriceLevel.svelte b/src/lib/components/DarkPool/PriceLevel.svelte index 1c5f913f..aa6eccfe 100644 --- a/src/lib/components/DarkPool/PriceLevel.svelte +++ b/src/lib/components/DarkPool/PriceLevel.svelte @@ -1,18 +1,19 @@
-
- - -
- {#if rawData?.length !== 0 && Object?.keys(metrics)?.length > 0}
@@ -176,22 +163,47 @@
- {#each ["Size", "Premium"] as item} - + {#each ["Today's Trend", "Price Level"] as item, index} + {#if data?.user?.tier === "Pro" || index === 0} + + {:else if data?.user?.tier !== "Pro"} + + {item} + + + {/if} {/each}
-
+ {#if category === "Price Level"} +
+ {:else} + + {/if}
{/if}
diff --git a/src/lib/components/DarkPool/RealtimeTrade.svelte b/src/lib/components/DarkPool/RealtimeTrade.svelte new file mode 100644 index 00000000..d7a042d0 --- /dev/null +++ b/src/lib/components/DarkPool/RealtimeTrade.svelte @@ -0,0 +1,206 @@ + + +
diff --git a/src/lib/components/FailToDeliver.svelte b/src/lib/components/FailToDeliver.svelte index 33843a68..8e816972 100644 --- a/src/lib/components/FailToDeliver.svelte +++ b/src/lib/components/FailToDeliver.svelte @@ -84,7 +84,7 @@ animation: false, }, title: { - text: `

${removeCompanyStrings($displayCompanyName)} FTD

`, + text: `

${removeCompanyStrings($displayCompanyName)} FTD

`, style: { color: "white", }, diff --git a/src/lib/components/Options/HottestContracts.svelte b/src/lib/components/Options/HottestContracts.svelte index 4302b366..a8a9ab2f 100644 --- a/src/lib/components/Options/HottestContracts.svelte +++ b/src/lib/components/Options/HottestContracts.svelte @@ -384,7 +384,7 @@ }, credits: { enabled: false }, title: { - text: `

Contract History

`, + text: `

Contract History

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/lib/components/Options/OpenInterestByExpiry.svelte b/src/lib/components/Options/OpenInterestByExpiry.svelte index 671673b0..d8ccd5e1 100644 --- a/src/lib/components/Options/OpenInterestByExpiry.svelte +++ b/src/lib/components/Options/OpenInterestByExpiry.svelte @@ -51,7 +51,7 @@ credits: { enabled: false }, legend: { enabled: false }, title: { - text: `

Open Interest By Expiry

`, + text: `

Open Interest By Expiry

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/lib/components/Options/OpenInterestByStrike.svelte b/src/lib/components/Options/OpenInterestByStrike.svelte index 302f7ba1..c5ceba56 100644 --- a/src/lib/components/Options/OpenInterestByStrike.svelte +++ b/src/lib/components/Options/OpenInterestByStrike.svelte @@ -49,7 +49,7 @@ credits: { enabled: false }, legend: { enabled: false }, title: { - text: `

Open Interest By Strike

`, + text: `

Open Interest By Strike

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/lib/components/Options/UnusualActivity.svelte b/src/lib/components/Options/UnusualActivity.svelte index 9a230ea4..49b043f8 100644 --- a/src/lib/components/Options/UnusualActivity.svelte +++ b/src/lib/components/Options/UnusualActivity.svelte @@ -148,6 +148,11 @@ enabled: false, }, plotOptions: { + column: { + groupPadding: 0.1, // Increase to add more space between groups of columns + pointPadding: 0.1, // Adjust to fine-tune spacing within a group + borderWidth: 0, // Optional: Remove borders if not needed + }, series: { color: "white", animation: false, // Disable series animation @@ -159,28 +164,25 @@ }, }, chart: { - // Removed global type so each series can define its own type. backgroundColor: "#09090B", plotBackgroundColor: "#09090B", height: 360, - width: 850, animation: false, }, title: { - text: `

${ticker} Unusual Options Activity

`, + text: `

${ticker} Unusual Options Activity

`, style: { color: "white", - // Using inline CSS for margin-top and margin-bottom }, - useHTML: true, // Enable HTML to apply custom class styling + useHTML: true, }, xAxis: { type: "datetime", endOnTick: false, categories: dates, crosshair: { - color: "#fff", // Set the color of the crosshair line - width: 1, // Adjust the line width as needed + color: "#fff", + width: 1, dashStyle: "Solid", }, labels: { @@ -196,10 +198,9 @@ }, }, tickPositioner: function () { - // Create custom tick positions with wider spacing const positions = []; const info = this.getExtremes(); - const tickCount = 5; // Reduce number of ticks displayed + const tickCount = 5; const interval = Math.floor((info.max - info.min) / tickCount); for (let i = 0; i <= tickCount; i++) { @@ -231,8 +232,8 @@ tooltip: { shared: true, useHTML: true, - backgroundColor: "rgba(0, 0, 0, 0.8)", // Semi-transparent black - borderColor: "rgba(255, 255, 255, 0.2)", // Slightly visible white border + backgroundColor: "rgba(0, 0, 0, 0.8)", + borderColor: "rgba(255, 255, 255, 0.2)", borderWidth: 1, style: { color: "#fff", @@ -241,7 +242,6 @@ }, borderRadius: 4, formatter: function () { - // Format the x value to display time in hh:mm format let tooltipContent = `${new Date( this?.x, ).toLocaleDateString("en-US", { @@ -250,12 +250,11 @@ day: "numeric", })}
`; - // Loop through each point in the shared tooltip this.points.forEach((point) => { tooltipContent += `${point.series.name}: - ${abbreviateNumber( - point.y, - )}
`; + ${abbreviateNumber( + point.y, + )}
`; }); return tooltipContent; @@ -267,8 +266,8 @@ type: "column", data: callData, color: "#00FC50", - borderColor: "#00FC50", // Match border color - borderRadius: "2px", + borderColor: "#00FC50", + borderRadius: "0px", marker: { enabled: false, }, @@ -279,8 +278,8 @@ type: "column", data: putData, color: "#EE5365", - borderColor: "#EE5365", // Match border color - borderRadius: "2px", + borderColor: "#EE5365", + borderRadius: "0px", marker: { enabled: false, }, @@ -304,11 +303,8 @@ [1, "rgba(255, 255, 255, 0.001)"], ], }, - // If you prefer a smooth (curved) line, you can use the "spline" type: - // type: "spline" }, ], - legend: { enabled: false, }, @@ -450,7 +446,7 @@ }, credits: { enabled: false }, title: { - text: `

Contract History

`, + text: `

Contract History

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/lib/components/Options/Volatility.svelte b/src/lib/components/Options/Volatility.svelte index 21c34223..20189f34 100644 --- a/src/lib/components/Options/Volatility.svelte +++ b/src/lib/components/Options/Volatility.svelte @@ -103,7 +103,7 @@ credits: { enabled: false }, legend: { enabled: false }, title: { - text: `

Volatiltiy Exposure

`, + text: `

Volatiltiy Exposure

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/lib/components/RatingsChart.svelte b/src/lib/components/RatingsChart.svelte index 9ea4c057..a1170e16 100644 --- a/src/lib/components/RatingsChart.svelte +++ b/src/lib/components/RatingsChart.svelte @@ -165,7 +165,7 @@ credits: { enabled: false }, legend: { enabled: false }, title: { - text: `

${symbol} - ${numOfRatings} Transaction

`, + text: `

${symbol} - ${numOfRatings} Transaction

`, useHTML: true, style: { color: "white" }, }, diff --git a/src/routes/etf/[tickerID]/dark-pool/+page.svelte b/src/routes/etf/[tickerID]/dark-pool/+page.svelte index 8c03d06d..7f5c8c5b 100644 --- a/src/routes/etf/[tickerID]/dark-pool/+page.svelte +++ b/src/routes/etf/[tickerID]/dark-pool/+page.svelte @@ -51,6 +51,7 @@ {#if priceLevel?.length > 0} diff --git a/src/routes/stocks/[tickerID]/dark-pool/+page.svelte b/src/routes/stocks/[tickerID]/dark-pool/+page.svelte index 558cd5c7..ed997e7b 100644 --- a/src/routes/stocks/[tickerID]/dark-pool/+page.svelte +++ b/src/routes/stocks/[tickerID]/dark-pool/+page.svelte @@ -51,6 +51,7 @@ {#if priceLevel?.length > 0} diff --git a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte index e286c1bc..31569fb7 100644 --- a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte +++ b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte @@ -65,7 +65,7 @@ animation: false, }, title: { - text: `

${removeCompanyStrings($displayCompanyName)} Revenue by ${convertToTitleCase(data?.getParams)}

`, + text: `

${removeCompanyStrings($displayCompanyName)} Revenue by ${convertToTitleCase(data?.getParams)}

`, style: { color: "white", // Using inline CSS for margin-top and margin-bottom diff --git a/src/routes/stocks/[tickerID]/profile/employees/+page.svelte b/src/routes/stocks/[tickerID]/profile/employees/+page.svelte index 0361a782..82cc325c 100644 --- a/src/routes/stocks/[tickerID]/profile/employees/+page.svelte +++ b/src/routes/stocks/[tickerID]/profile/employees/+page.svelte @@ -93,7 +93,7 @@ animation: false, }, title: { - text: `

${removeCompanyStrings($displayCompanyName)} Employees

`, + text: `

${removeCompanyStrings($displayCompanyName)} Employees

`, style: { color: "white", },