Object?.values(sectionMap)?.includes(part));
+ const foundSection = parts?.find((part) =>
+ Object?.values(sectionMap)?.includes(part),
+ );
- displaySubSection = Object?.keys(sectionMap)?.find((key) => sectionMap[key] === foundSection) || "overview";
+ displaySubSection =
+ Object?.keys(sectionMap)?.find(
+ (key) => sectionMap[key] === foundSection,
+ ) || "overview";
}
function changeSubSection(state) {
@@ -39,7 +44,10 @@
const unsubscribe = page.subscribe(($page) => {
const splitRoute = $page.url.pathname.split("/");
- const routeState = splitRoute[splitRoute.length - 1] !== "forecast" ? splitRoute[splitRoute.length - 1] : "overview";
+ const routeState =
+ splitRoute[splitRoute.length - 1] !== "forecast"
+ ? splitRoute[splitRoute.length - 1]
+ : "overview";
changeSubSection(routeState);
});
@@ -49,37 +57,70 @@
});
-
+
-
+
-
-
-
+
- changeSubSection("overview")} - class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'overview' ? 'text-white ' : 'bg-[#09090B]'}" + class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'overview' + ? 'text-white ' + : 'bg-[#09090B]'}" > Overview - +
- - changeSubSection("ai")} class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'ai' ? 'text-white ' : 'bg-[#09090B]'}"> + changeSubSection("ai")} + class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'ai' + ? 'text-white ' + : 'bg-[#09090B]'}" + > AI - +
- changeSubSection("analyst")} - class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'analyst' ? 'text-white ' : 'bg-[#09090B]'}" + class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'analyst' + ? 'text-white ' + : 'bg-[#09090B]'}" > Analysts - +
- - (changeSubSection('insider'))} class="text-xs sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'insider' ? 'text-white ' : 'bg-[#09090B]'}" > - Insider Trading - - - -
- - (changeSubSection('congress-trading'))} class="text-xs sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'congress-trading' ? 'text-white ' : 'bg-[#09090B]'}" > - Congress Trading - - - -
- - (changeSubSection('transcripts'))} class="text-xs sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === 'transcripts' ? 'text-white ' : 'bg-[#09090B]'}" > - Transcripts - - - -
- + changeSubSection("insider")} + class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'insider' + ? 'text-white ' + : 'bg-[#09090B]'}" + > + Insider Trading + + + +
- + changeSubSection("congress-trading")} + class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'congress-trading' + ? 'text-white ' + : 'bg-[#09090B]'}" + > + Congress Trading + + + +
- + changeSubSection("transcripts")} + class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === + 'transcripts' + ? 'text-white ' + : 'bg-[#09090B]'}" + > + Transcripts + + + +
+
diff --git a/src/routes/stocks/[tickerID]/forecast/+page.svelte b/src/routes/stocks/[tickerID]/forecast/+page.svelte
index 6ac03cb8..7101ecdb 100644
--- a/src/routes/stocks/[tickerID]/forecast/+page.svelte
+++ b/src/routes/stocks/[tickerID]/forecast/+page.svelte
@@ -1,5 +1,10 @@
-
-
+
+
diff --git a/src/routes/stocks/[tickerID]/insider/+layout.svelte b/src/routes/stocks/[tickerID]/insider/+layout.svelte
index 8e2e1881..d7d8d896 100644
--- a/src/routes/stocks/[tickerID]/insider/+layout.svelte
+++ b/src/routes/stocks/[tickerID]/insider/+layout.svelte
@@ -1,122 +1,148 @@
-
-
-
+
-
Financial Forecast this Year
- {#if data?.getAnalystEstimate?.length !== 0} -
-
-
-
-
-
-
-
-
- {abbreviateNumber(data?.getAnalystEstimate[index - 1]?.estimatedRevenueAvg)}
-
-
-
- {abbreviateNumber(changeRevenue?.toFixed(1))}%
-
-
- from {abbreviateNumber(data?.getAnalystEstimate[index - 2]?.revenue)}
-
-
-
-
-
-
-
- {abbreviateNumber(data?.getAnalystEstimate[index - 1]?.estimatedNetIncomeAvg)}
-
-
-
- {abbreviateNumber(changeNetIncome?.toFixed(1))}%
-
-
- from {abbreviateNumber(data?.getAnalystEstimate[index - 2]?.netIncome)}
-
-
-
-
-
-
-
- {abbreviateNumber(data?.getAnalystEstimate[index - 1]?.estimatedEbitdaAvg)}
-
-
-
- {abbreviateNumber(changeEBITDA?.toFixed(2))}%
-
-
- from {abbreviateNumber(data?.getAnalystEstimate[index - 2]?.ebitda)}
-
-
-
-
-
-
-
- {data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg}
-
-
-
- {abbreviateNumber(changeEPS?.toFixed(1))}%
-
-
- from {data?.getAnalystEstimate[index - 2]?.eps}
-
-
- {#await import("$lib/components/AnalystEstimate.svelte") then { default: Comp }}
-
- {/await}
-
- {:else}
-
-
+
+
+ + Financial Forecast this Year +
+ {#if data?.getAnalystEstimate?.length !== 0} +
- No analyst forecast available for {$displayCompanyName}.
-
- {/if}
+
+
+
+
+
+
+ {abbreviateNumber(
+ data?.getAnalystEstimate[index - 1]?.estimatedRevenueAvg,
+ )}
+
+
+
+ {abbreviateNumber(changeRevenue?.toFixed(1))}%
+
+
+ from {abbreviateNumber(
+ data?.getAnalystEstimate[index - 2]?.revenue,
+ )}
+
+
+
+
+
+
+
+ {abbreviateNumber(
+ data?.getAnalystEstimate[index - 1]
+ ?.estimatedNetIncomeAvg,
+ )}
+
+
+
+ {abbreviateNumber(changeNetIncome?.toFixed(1))}%
+
+
+ from {abbreviateNumber(
+ data?.getAnalystEstimate[index - 2]?.netIncome,
+ )}
+
+
+
+
+
+
+
+ {abbreviateNumber(
+ data?.getAnalystEstimate[index - 1]?.estimatedEbitdaAvg,
+ )}
+
+
+
+ {abbreviateNumber(changeEBITDA?.toFixed(2))}%
+
+
+ from {abbreviateNumber(
+ data?.getAnalystEstimate[index - 2]?.ebitda,
+ )}
+
+
+
+
+
+
+
+ {data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg}
+
+
+
+ {abbreviateNumber(changeEPS?.toFixed(1))}%
+
+
+ from {data?.getAnalystEstimate[index - 2]?.eps}
+
+
+ {#await import("$lib/components/AnalystEstimate.svelte") then { default: Comp }}
+
+ {/await}
+
+ {:else}
+
+
+ No analyst forecast available for {$displayCompanyName}.
+
+ {/if}
+
-
-
-
-
+
+
+
diff --git a/src/routes/stocks/[tickerID]/insider/+page.svelte b/src/routes/stocks/[tickerID]/insider/+page.svelte
index 56d4eb8b..436994e7 100644
--- a/src/routes/stocks/[tickerID]/insider/+page.svelte
+++ b/src/routes/stocks/[tickerID]/insider/+page.svelte
@@ -11,7 +11,6 @@
import { Button } from "$lib/components/shadcn/button/index.js";
import TableHeader from "$lib/components/Table/TableHeader.svelte";
-
export let data;
let isLoaded = false;
@@ -22,7 +21,6 @@
let quarter = Math.floor(now.getMonth() / 3) + 1;
let yearRange = [];
-
function calculateInsiderTradingStatistics(data, year, quarter) {
// Helper function to check if the transaction date is within the current quarter
const isInCurrentQuarter = (transactionDate) => {
@@ -114,9 +112,7 @@
yearRange = Array.from(
new Set(
- rawData?.map((item) =>
- (new Date(item?.transactionDate))?.getFullYear(),
- ),
+ rawData?.map((item) => new Date(item?.transactionDate)?.getFullYear()),
),
)?.sort((a, b) => b - a);
if (yearRange?.length > 0) {
@@ -150,7 +146,6 @@
"n/a": { text: "n/a", class: "text-gray-300" },
};
-
let columns = [
{ key: "reportingName", label: "Name", align: "left" },
{ key: "transactionDate", label: "Date", align: "right" },
@@ -167,8 +162,7 @@
value: { order: "none", type: "number" },
};
-
- const sortData = (key) => {
+ const sortData = (key) => {
// Reset all other keys to 'none' except the current key
for (const k in sortOrders) {
if (k !== key) {
@@ -188,7 +182,7 @@
// Reset to original data when 'none' and stop further sorting
if (sortOrder === "none") {
- insiderTradingList = [...originalData]?.slice(0,50); // Reset to original data (spread to avoid mutation)
+ insiderTradingList = [...originalData]?.slice(0, 50); // Reset to original data (spread to avoid mutation)
return;
}
@@ -223,11 +217,11 @@
};
// Sort using the generic comparison function
- insiderTradingList = [...originalData].sort(compareValues)?.slice(0,50);
+ insiderTradingList = [...originalData].sort(compareValues)?.slice(0, 50);
};
-$: {
- if((year || quarter ) && typeof window !== 'undefined') {
+ $: {
+ if ((year || quarter) && typeof window !== "undefined") {
statistics = calculateInsiderTradingStatistics(rawData, year, quarter);
buySellRatio =
statistics?.soldShares !== 0
@@ -276,14 +270,14 @@ $: {
-
-
+
+
+-
-
+
+
+
+
+
+
+
+ -
+
+
-
-
+
+
- {#each [1,2,3,4] as index}
- (quarter = index)}
- class="cursor-pointer hover:bg-[#27272A]"
- >
- Q{index}
-
+ {#each [1, 2, 3, 4] as index}
+ (quarter = index)}
+ class="cursor-pointer hover:bg-[#27272A]"
+ >
+ Q{index}
+
{/each}
@@ -613,9 +607,9 @@ $: {
-
-
Insider Trading
@@ -391,13 +385,13 @@ $: {| Date | -% Change | -P/C | -Bear/Bull | -Bid/Ask Vol | -% OTM | -Total Volume | -Total OI | -Total Prem | -
| - {formatDate(item?.date)} - | - -- {#if item?.changesPercentage >=0} - +{item?.changesPercentage >= 1000 ? abbreviateNumber(item?.changesPercentage) : item?.changesPercentage?.toFixed(2)}% - {:else} - {item?.changesPercentage <= -1000 ? abbreviateNumber(item?.changesPercentage) : item?.changesPercentage?.toFixed(2)}% - {/if} - | - -- {item?.c_vol !== 0 ? (item?.p_vol/item?.c_vol)?.toFixed(1) : '-'} - | - -
- {#if item?.bear_ratio > (item?.neutral_ratio ?? 0) && item?.bear_ratio > (item?.bull_ratio ?? 0)}
-
- {item?.bear_ratio?.toFixed(0)}% Bearish
-
- {:else if item?.bull_ratio > (item?.neutral_ratio ?? 0) && item?.bull_ratio > (item?.bear_ratio ?? 0)}
-
- {item?.bull_ratio?.toFixed(0)}% Bullish
-
- {:else if item?.neutral_ratio > (item?.bull_ratio ?? 0) && item?.neutral_ratio > (item?.bear_ratio ?? 0)}
-
- {item?.neutral_ratio?.toFixed(0)}% Neutral
-
- {:else if item?.bear_ratio === item?.bull_ratio && item?.bear_ratio > (item?.neutral_ratio ?? 0)}
-
- {item?.bear_ratio?.toFixed(0)}% Bear/Bull Tie
-
- {:else if item?.bear_ratio === item?.neutral_ratio && item?.bear_ratio > (item?.bull_ratio ?? 0)}
-
- {item?.bear_ratio?.toFixed(0)}% Bear/Neutral Tie
-
- {:else if item?.bull_ratio === item?.neutral_ratio && item?.bull_ratio > (item?.bear_ratio ?? 0)}
-
- {item?.bull_ratio?.toFixed(0)}% Bull/Neutral Tie
-
- {:else}
-
- Equal Distribution
-
- {/if}
- |
-
-
- {#if item?.bid_ratio > (item?.midpoint_ratio ?? 0) && item?.bid_ratio > (item?.ask_ratio ?? 0)}
-
- {item?.bid_ratio?.toFixed(0)}% Bid
-
- {:else if item?.ask_ratio > (item?.midpoint_ratio ?? 0) && item?.ask_ratio > (item?.bid_ratio ?? 0)}
-
- {item?.ask_ratio?.toFixed(0)}% Ask
-
- {:else if item?.midpoint_ratio > (item?.ask_ratio ?? 0) && item?.midpoint_ratio > (item?.bid_ratio ?? 0)}
-
- {item?.midpoint_ratio?.toFixed(0)}% Midpoint
-
- {:else if item?.bid_ratio === item?.ask_ratio && item?.bid_ratio > (item?.midpoint_ratio ?? 0)}
-
- {item?.bid_ratio?.toFixed(0)}% Bid/Ask Tie
-
- {:else if item?.bid_ratio === item?.midpoint_ratio && item?.bid_ratio > (item?.ask_ratio ?? 0)}
-
- {item?.bid_ratio?.toFixed(0)}% Bid/Neutral Tie
-
- {:else if item?.ask_ratio === item?.midpoint_ratio && item?.ask_ratio > (item?.bid_ratio ?? 0)}
-
- {item?.ask_ratio?.toFixed(0)}% Ask/Neutral Tie
-
- {:else}
-
- Equal Distribution
-
- {/if}
- |
-
- - {item?.otm_ratio?.toFixed(0)}% - | - - - -- {abbreviateNumber(item?.total_volume)} - | - -- {abbreviateNumber(item?.total_oi)} - | - - -- {abbreviateNumber(item?.total_bull_prem+item?.total_bear_prem+item?.total_neutral_prem,true)} - | - - - -
| Call Prem | -Call OI | -Call Volume | -Strike Price | -Put Volume | -Put OI | -Put Prem | -
| - {abbreviateNumber(item?.total_premium_call,true)} - | - -- {abbreviateNumber(item?.total_open_interest_call)} - | - -- {abbreviateNumber(item?.total_volume_call)} - | - -
-
- {item?.strike_price}
-
- |
-
- - {abbreviateNumber(item?.total_volume_put)} - | - -- {abbreviateNumber(item?.total_open_interest_put)} - | - - -- {abbreviateNumber(item?.total_premium_put,true)} - | - - -
-
- {/if}
-
- {/if}
-
-
-
-
-
-
- No Options activity found
-
-
+ {displayTotalVolume}
+
+
+
+
+ {displayTotalOpenInterest}
+
+
+
+
+
+ {putCallRatio !== "Infinity" ? putCallRatio : "> 1"}
+
+
+
-
+
+
+ {putCallOpenInterestRatio !== "Infinity"
+ ? putCallOpenInterestRatio
+ : "> 1"}
+
+
+
+
+
+
+
+
+ {#if filteredList?.length !== 0}
+
+ {:else}
+
+
+
+ {#if data?.getOptionsGexData?.length !== 0}
+
+
+ No Options activity found
+
+
+ {/if}
+ + {activeEX === 0 + ? "Daily Gamma Exposure (GEX)" + : "Daily Delta Exposure (DEX)"} +
+ +
+ {#each tabEX as item, i}
+
+ {/each}
+
+
+
+
+
+ {/if}
+
+ + {activeIdx === 0 ? "Historical Option Data" : "Option Chain Data"} +
+ + {#if optionList?.length !== 0} +
+ {#each tabs as item, i}
+
+ {/each}
+
+
+ {#if activeIdx === 1}
+
+
+
+ {/if}
+
+
+ {#if activeIdx === 0}
+
+
+
+ {:else}
+
+
+
+ {/if}
+
+
+ | Date | +% Change | +P/C | +Bear/Bull | +Bid/Ask Vol | +% OTM | +Total Volume | +Total OI | +Total Prem | +
| + {formatDate(item?.date)} + | + ++ {#if item?.changesPercentage >= 0} + +{item?.changesPercentage >= 1000 + ? abbreviateNumber(item?.changesPercentage) + : item?.changesPercentage?.toFixed(2)}% + {:else} + {item?.changesPercentage <= -1000 + ? abbreviateNumber(item?.changesPercentage) + : item?.changesPercentage?.toFixed(2)}% + + {/if} + | + ++ {item?.c_vol !== 0 + ? (item?.p_vol / item?.c_vol)?.toFixed(1) + : "-"} + | + +
+ {#if item?.bear_ratio > (item?.neutral_ratio ?? 0) && item?.bear_ratio > (item?.bull_ratio ?? 0)}
+
+ {item?.bear_ratio?.toFixed(0)}% Bearish
+
+ {:else if item?.bull_ratio > (item?.neutral_ratio ?? 0) && item?.bull_ratio > (item?.bear_ratio ?? 0)}
+
+ {item?.bull_ratio?.toFixed(0)}% Bullish
+
+ {:else if item?.neutral_ratio > (item?.bull_ratio ?? 0) && item?.neutral_ratio > (item?.bear_ratio ?? 0)}
+
+ {item?.neutral_ratio?.toFixed(0)}% Neutral
+
+ {:else if item?.bear_ratio === item?.bull_ratio && item?.bear_ratio > (item?.neutral_ratio ?? 0)}
+
+ {item?.bear_ratio?.toFixed(0)}% Bear/Bull Tie
+
+ {:else if item?.bear_ratio === item?.neutral_ratio && item?.bear_ratio > (item?.bull_ratio ?? 0)}
+
+ {item?.bear_ratio?.toFixed(0)}% Bear/Neutral Tie
+
+ {:else if item?.bull_ratio === item?.neutral_ratio && item?.bull_ratio > (item?.bear_ratio ?? 0)}
+
+ {item?.bull_ratio?.toFixed(0)}% Bull/Neutral Tie
+
+ {:else}
+
+ Equal Distribution
+
+ {/if}
+ |
+
+
+ {#if item?.bid_ratio > (item?.midpoint_ratio ?? 0) && item?.bid_ratio > (item?.ask_ratio ?? 0)}
+
+ {item?.bid_ratio?.toFixed(0)}% Bid
+
+ {:else if item?.ask_ratio > (item?.midpoint_ratio ?? 0) && item?.ask_ratio > (item?.bid_ratio ?? 0)}
+
+ {item?.ask_ratio?.toFixed(0)}% Ask
+
+ {:else if item?.midpoint_ratio > (item?.ask_ratio ?? 0) && item?.midpoint_ratio > (item?.bid_ratio ?? 0)}
+
+ {item?.midpoint_ratio?.toFixed(0)}% Midpoint
+
+ {:else if item?.bid_ratio === item?.ask_ratio && item?.bid_ratio > (item?.midpoint_ratio ?? 0)}
+
+ {item?.bid_ratio?.toFixed(0)}% Bid/Ask Tie
+
+ {:else if item?.bid_ratio === item?.midpoint_ratio && item?.bid_ratio > (item?.ask_ratio ?? 0)}
+
+ {item?.bid_ratio?.toFixed(0)}% Bid/Neutral Tie
+
+ {:else if item?.ask_ratio === item?.midpoint_ratio && item?.ask_ratio > (item?.bid_ratio ?? 0)}
+
+ {item?.ask_ratio?.toFixed(0)}% Ask/Neutral Tie
+
+ {:else}
+
+ Equal Distribution
+
+ {/if}
+ |
+
+ + {item?.otm_ratio?.toFixed(0)}% + | + ++ {abbreviateNumber(item?.total_volume)} + | + ++ {abbreviateNumber(item?.total_oi)} + | + ++ {abbreviateNumber( + item?.total_bull_prem + + item?.total_bear_prem + + item?.total_neutral_prem, + true, + )} + | +
| Call Prem | +Call OI | +Call Volume | +Strike Price | +Put Volume | +Put OI | +Put Prem | +
| + {abbreviateNumber(item?.total_premium_call, true)} + | + ++ {abbreviateNumber(item?.total_open_interest_call)} + | + ++ {abbreviateNumber(item?.total_volume_call)} + | + +
+
+ {item?.strike_price}
+
+ |
+
+ + {abbreviateNumber(item?.total_volume_put)} + | + ++ {abbreviateNumber(item?.total_open_interest_put)} + | + ++ {abbreviateNumber(item?.total_premium_put, true)} + | +
+
+ {/if}
+ {/if}
+
+
+ No Options activity found
+
+