+
@@ -604,7 +526,7 @@
{#if userWatchList?.length !== 0}
@@ -724,27 +646,16 @@
-
+
-
-
-
-
-
+
{$etfTicker?.toUpperCase()}
{$displayCompanyName?.length > charNumber
? $displayCompanyName?.slice(0, charNumber) +
@@ -753,33 +664,6 @@
-
-
-
-
-
-
-
-
@@ -787,228 +671,104 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1024,135 +784,11 @@
{/if}
-
-
+
{#if PriceAlert}
{/if}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {$displayCompanyName?.length > 30
- ? $displayCompanyName?.slice(0, 30) + "..."
- : $displayCompanyName}
-
-
-
- Current Price: ${$currentPortfolioPrice}
-
-
- Holding Shares: {holdingShares}
-
-
-
-
-
-
-
Type of Trade
-
-
-
-
-
-
-
-
@@ -1222,7 +858,6 @@
ic_fluent_checkmark_circle_48_filled
Created with Sketch.
diff --git a/src/routes/etf/[tickerID]/+layout.ts b/src/routes/etf/[tickerID]/+layout.ts
index 30966f4c..0f19dcab 100644
--- a/src/routes/etf/[tickerID]/+layout.ts
+++ b/src/routes/etf/[tickerID]/+layout.ts
@@ -1,11 +1,11 @@
import {
- displayCompanyName,
- etfTicker,
- assetType,
isOpen,
isAfterMarketClose,
isBeforeMarketOpen,
isWeekend,
+ etfTicker,
+ displayCompanyName,
+ assetType,
} from "$lib/store";
const checkMarketHour = async () => {
@@ -52,9 +52,9 @@ const checkMarketHour = async () => {
isAfterMarketClose.set(isAfterMarketCloseValue);
};
-export const load = async ({ params, data }) => {
- etfTicker.update((value) => params.tickerID?.toUpperCase());
- assetType.update((value) => "etf");
- displayCompanyName.update((value) => data?.companyName);
+export const load = async ({ data }) => {
+ etfTicker.set(data?.getParams?.toUpperCase());
+ assetType.set("etf");
+ displayCompanyName.set(data?.companyName);
await checkMarketHour();
};
diff --git a/src/routes/etf/[tickerID]/+page.server.ts b/src/routes/etf/[tickerID]/+page.server.ts
index 78340db8..05e315c0 100644
--- a/src/routes/etf/[tickerID]/+page.server.ts
+++ b/src/routes/etf/[tickerID]/+page.server.ts
@@ -34,10 +34,10 @@ export const actions = {
error(err.status, err.message);
}
- redirect(301, "/");
+ redirect(302, "/");
},
- register: async ({ locals, request, params }) => {
+ register: async ({ locals, request }) => {
const { formData, errors } = await validateData(
await request.formData(),
registerUserSchema,
@@ -59,6 +59,7 @@ await locals.pb?.collection('users').update(
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
*/
+
await locals.pb.collection("users").requestVerification(formData.email);
} catch (err) {
console.log("Error: ", err);
@@ -74,7 +75,7 @@ await locals.pb?.collection('users').update(
error(err.status, err.message);
}
- redirect(303, "/etf/" + params.tickerID);
+ redirect(303, "/");
},
oauth2: async ({ url, locals, request, cookies, params }) => {
diff --git a/src/routes/etf/[tickerID]/+page.svelte b/src/routes/etf/[tickerID]/+page.svelte
index b3067558..e6d17c8e 100644
--- a/src/routes/etf/[tickerID]/+page.svelte
+++ b/src/routes/etf/[tickerID]/+page.svelte
@@ -1,77 +1,45 @@
@@ -667,7 +768,7 @@
+
@@ -689,32 +791,29 @@
/>
+
-
-
-
+
+
+
-
+
- {#if $isCrosshairMoveActive}
- {displayLegend?.close}
- {:else if !$isCrosshairMoveActive && $realtimePrice !== null}
- {$realtimePrice}
- {:else}
- {displayLegend?.close}
- {/if}
+ {displayLegend?.close}
{#if $priceIncrease === true}
- {#if displayLegend?.change >= 0}
-
-
+{displayLegend?.change}%
- {:else if displayLegend?.change < 0}
-
-
{displayLegend?.change}%
-
- {/if}
+
{displayLegend?.change ?? "-"}%
{displayLegend?.date}
- {#if Object?.keys(prePostData)?.length !== 0 && prePostData?.price !== 0}
-
-
-
- {prePostData?.price}
-
- {#if prePostData?.changesPercentage >= 0}
-
({prePostData?.changesPercentage}%)
+ {#if Object?.keys(prePostData)?.length !== 0 && prePostData?.price !== 0}
+
+
+
+ {prePostData?.price}
+
+ {#if prePostData?.changesPercentage >= 0}
+ ({prePostData?.changesPercentage}%)
+ {:else if prePostData?.changesPercentage < 0}
+ ({prePostData?.changesPercentage}%)
+ {/if}
+
+ {#if $isBeforeMarketOpen && !$isOpen && !$isWeekend}
+
- {:else if prePostData?.changesPercentage < 0}
-
({prePostData?.changesPercentage}%) Pre-market:
+
+
+ {:else}
+
{/if}
- {#if $isBeforeMarketOpen && !$isOpen && !$isWeekend}
-
- {:else}
-
- {/if}
-
- {/if}
+ {/if}
+
-
-
-
changeData("1D")}
- class="text-sm font-medium text-gray-400 {displayData === '1D'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1D
-
-
-
-
-
changeData("1W")}
- class="w-full text-sm font-medium text-gray-400 {displayData ===
- '1W'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1W
-
-
-
-
-
changeData("1M")}
- class="text-sm font-medium text-gray-400 {displayData === '1M'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1M
-
-
-
-
-
changeData("6M")}
- class="text-sm font-medium text-gray-400 {displayData === '6M'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 6M
-
-
-
-
-
changeData("1Y")}
- class="text-sm font-medium text-gray-400 {displayData === '1Y'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1Y
-
-
-
+ {#if !$etfTicker?.includes(".")}
+
+
+
+ Export
+
+
+
+
+
+
+
+ Historical Stock Price
+
+
+
+
+ exportData("30min")}
+ class="cursor-pointer hover:bg-[#27272A]"
+ >
+
-
-
changeData("MAX")}
- class="text-sm font-medium text-gray-400 {displayData === 'MAX'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- MAX
-
-
-
+ 30 min
+
+ exportData("1hour")}
+ class="cursor-pointer hover:bg-[#27272A]"
+ >
+
+ 1 hour
+
+ exportData("max")}
+ class="cursor-pointer hover:bg-[#27272A]"
+ >
+ 1 day
+
+
+
+
+ {/if}
- {#if output !== null}
-
- {#if displayData === "1D" && oneDayPrice?.length === 0}
-
- No data available
-
- {:else if displayData === "1W" && oneWeekPrice?.length === 0}
-
- No data available
-
- {:else if displayData === "1M" && oneMonthPrice?.length === 0}
-
- No data available
-
- {:else if displayData === "6M" && sixMonthPrice?.length === 0}
-
- No data available
-
- {:else if displayData === "1Y" && oneYearPrice?.length === 0}
-
- No data available
-
- {:else if displayData === "MAX" && threeYearPrice?.length === 0}
-
- No data available
-
- {:else}
-
(chart = ref)}
- on:crosshairMove={handleCrosshairMove}
- >
- {#if displayData === "1D"}
- {#if displayChartType === "line"}
+
+ {#if dataMapping[displayData]?.length === 0}
+
+
+
+
+ = 0
+ ? "before:content-['+'] text-[#00FC50]"
+ : "text-[#FF2F1F]"}
+ >
+ {displayLegend?.change ?? "-"}%
+
+ ({displayData})
+
+
+
+
+
+ No {displayData} chart data available
+
+
+
+
+ {:else}
+
+
+
+
+ = 0
+ ? "before:content-['+'] text-[#00FC50]"
+ : "text-[#FF2F1F]"}
+ >
+ {displayLegend?.change}%
+
+ ({displayData})
+
+
+
+ {#if output !== null && dataMapping[displayData]?.length !== 0}
+
(chart = api)}
+ >
+ {#if displayData === "1D"}
({
time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
- {/if}
- {:else if displayData === "1W"}
- {#if displayChartType === "line"}
+ {:else if displayData === "1W"}
({
time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
- {/if}
- {:else if displayData === "1M"}
- {#if displayChartType === "line"}
+ {:else if displayData === "1M"}
({
- time,
+ time: time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
- {/if}
- {:else if displayData === "6M"}
- {#if displayChartType === "line"}
+ {:else if displayData === "6M"}
({
time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
- {/if}
- {:else if displayData === "1Y"}
- {#if displayChartType === "line"}
+ {:else if displayData === "1Y"}
({
time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
- {/if}
- {:else if displayData === "MAX"}
- {#if displayChartType === "line"}
+ {:else if displayData === "MAX"}
({
+ data={maxPrice?.map(({ time, close }) => ({
time,
value: close,
}))}
lineWidth={1.5}
- priceScaleId="left"
+ priceScaleId="right"
lineColor={colorChange}
topColor={topColorChange}
bottomColor={bottomColorChange}
- crosshairMarkerVisible={false}
ref={handleSeriesReference}
priceLineVisible={false}
- lastPriceAnimation={1}
>
- {:else}
-
-
-
{/if}
- {/if}
-
- {/if}
-
- {:else}
-
-
-
-
-
-
+
+ {:else}
+
+ {/if}
+ {/if}
+
+
+
+ Bid
+ {$wsBidPrice !== 0 && $wsBidPrice !== null
+ ? $wsBidPrice
+ : (data?.getStockQuote?.bid ?? "-")}
+ Market Cap
+ {abbreviateNumber(data?.getStockQuote?.marketCap)}
+ Revenue (ttm)
+ {stockDeck?.revenueTTM !== null
+ ? abbreviateNumber(stockDeck?.revenueTTM)
+ : "n/a"}
+ Net Income (ttm)
+ {stockDeck?.netIncomeTTM !== null
+ ? abbreviateNumber(stockDeck?.netIncomeTTM)
+ : "n/a"}
+
+ EPS (ttm)
+ {data?.getStockQuote?.eps}
+ PE Ratio (ttm)
+ {data?.getStockQuote?.pe}
+ Forward PE
+ {stockDeck?.forwardPE ?? "n/a"}
+ Shares Out
+
+ {data?.getStockQuote?.sharesOutstanding !== null
+ ? abbreviateNumber(
+ data?.getStockQuote?.sharesOutstanding,
+ )
+ : "n/a"}
+ Short % of Shares Out
+ {stockDeck?.shortOutStandingPercent !== null
+ ? stockDeck?.shortOutStandingPercent + "%"
+ : "n/a"}
+
+
+
+ Ask
+ {$wsAskPrice !== 0 && $wsAskPrice !== null
+ ? $wsAskPrice
+ : (data?.getStockQuote?.ask ?? "-")}
+ Volume
+ {abbreviateNumber(data?.getStockQuote?.volume)}
+ Open
+ {data?.getStockQuote?.open?.toFixed(2)}
+ Previous Close
+ {data?.getStockQuote?.previousClose?.toFixed(2)}
+ Day's Range
+ {data?.getStockQuote?.dayLow?.toFixed(2)} - {data?.getStockQuote?.dayHigh?.toFixed(
+ 2,
+ )}
+ 52-Week Range
+ {data?.getStockQuote?.yearLow?.toFixed(2)} - {data?.getStockQuote?.yearHigh?.toFixed(
+ 2,
+ )}
+ Beta
+ {stockDeck?.beta?.toFixed(2)}
+ Shares Float
+
+ {stockDeck?.floatShares !== null
+ ? abbreviateNumber(stockDeck?.floatShares)
+ : "n/a"}
+ Short % of Float
+ {stockDeck?.shortFloatPercent !== null
+ ? stockDeck?.shortFloatPercent + "%"
+ : "n/a"}
+
+
- {/if}
+
-
-
-
-
changeData("1D")}
- class="text-sm font-medium text-gray-400 {displayData === '1D'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1D
-
-
-
-
-
changeData("1W")}
- class="w-full text-sm font-medium text-gray-400 {displayData ===
- '1W'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1W
-
-
-
-
-
changeData("1M")}
- class="text-sm font-medium text-gray-400 {displayData === '1M'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1M
-
-
-
-
-
changeData("6M")}
- class="text-sm font-medium text-gray-400 {displayData === '6M'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 6M
-
-
-
-
-
changeData("1Y")}
- class="text-sm font-medium text-gray-400 {displayData === '1Y'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- 1Y
-
-
-
-
-
-
changeData("MAX")}
- class="text-sm font-medium text-gray-400 {displayData === 'MAX'
- ? 'text-white '
- : 'bg-[#09090B]'}"
- >
- MAX
-
-
-
-
-
-
- {#if ETFKeyInformation && $screenWidth <= 1022}
-
-
-
- Key Information
-
-
-
- {/if}
-
-
+
+
+
- {#await import("$lib/components/WIIM.svelte") then { default: Comp }}
-
- {/await}
+
-
-
-
- {#await import("$lib/components/FOMCImpact.svelte") then { default: Comp }}
-
- {/await}
+
+
-
-
-
-
- {#await import("$lib/components/VaR.svelte") then { default: Comp }}
-
- {/await}
-
-
-
-
-
- {#await import("$lib/components/OptionsData.svelte") then { default: Comp }}
-
- {/await}
-
-
-
-
-
- {#await import("$lib/components/OptionsNetFlow.svelte") then { default: Comp }}
-
- {/await}
-
-
-
-
-
- {#await import("$lib/components/FailToDeliver.svelte") then { default: Comp }}
-
- {/await}
-
-
-
-
-
-
-
- {#if CountrySegmentation}
-
- {/if}
-
-
-
-
- {#if SectorSegmentation}
-
- {/if}
-
-
-
-
-
- {#await import("$lib/components/TARating.svelte") then { default: Comp }}
-
- {/await}
-
-
-
-
diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte
index 0b8316c0..b8157c3b 100644
--- a/src/routes/stocks/[tickerID]/+page.svelte
+++ b/src/routes/stocks/[tickerID]/+page.svelte
@@ -12,7 +12,7 @@
wsBidPrice,
wsAskPrice,
currentPortfolioPrice,
- stockTicker,
+ etfTicker,
displayCompanyName,
isOpen,
isBeforeMarketOpen,
@@ -156,7 +156,7 @@
//==========================//
$: {
- if ($stockTicker && typeof window !== "undefined") {
+ if ($etfTicker && typeof window !== "undefined") {
// add a check to see if running on client-side
if ($realtimePrice !== null && $realtimePrice !== 0) {
$realtimePrice =
@@ -291,7 +291,7 @@
let maxPrice = [];
async function historicalPrice(timePeriod: string) {
- const cachedData = getCache($stockTicker, "historicalPrice" + timePeriod);
+ const cachedData = getCache($etfTicker, "historicalPrice" + timePeriod);
if (cachedData) {
switch (timePeriod) {
case "one-week":
@@ -316,7 +316,7 @@
output = null;
const postData = {
- ticker: $stockTicker,
+ ticker: $etfTicker,
timePeriod: timePeriod,
};
@@ -362,7 +362,7 @@
default:
console.log(`Unsupported time period: ${timePeriod}`);
}
- setCache($stockTicker, mappedData, "historicalPrice" + timePeriod);
+ setCache($etfTicker, mappedData, "historicalPrice" + timePeriod);
} catch (e) {
console.log(e);
}
@@ -423,7 +423,7 @@
async function getPrePostQuote() {
if (!$isOpen) {
- const postData = { ticker: $stockTicker, path: "pre-post-quote" };
+ const postData = { ticker: $etfTicker, path: "pre-post-quote" };
const response = await fetch("/api/ticker-data", {
method: "POST",
headers: {
@@ -636,7 +636,7 @@
headers: {
"Content-Type": "application/json",
},
- body: JSON.stringify({ ticker: $stockTicker, timePeriod: timePeriod }),
+ body: JSON.stringify({ ticker: $etfTicker, timePeriod: timePeriod }),
});
exportList = await response.json();
@@ -670,7 +670,7 @@
const a = document.createElement("a");
a.setAttribute("hidden", "");
a.setAttribute("href", url);
- a.setAttribute("download", `${$stockTicker}_${timePeriod}.csv`);
+ a.setAttribute("download", `${$etfTicker}_${timePeriod}.csv`);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
@@ -738,7 +738,7 @@
});
$: {
- if ($stockTicker && typeof window !== "undefined") {
+ if ($etfTicker && typeof window !== "undefined") {
// add a check to see if running on client-side
shouldUpdatePriceChart.set(false);
oneDayPrice = [];
@@ -769,21 +769,21 @@
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
- {$displayCompanyName} ({$stockTicker}) Stock Price, Quote & News 路 stocknear
+ {$displayCompanyName} ({$etfTicker}) Stock Price, Quote & News 路 stocknear
@@ -793,11 +793,11 @@
@@ -907,7 +907,7 @@
- {#if !$stockTicker?.includes(".")}
+ {#if !$etfTicker?.includes(".")}