diff --git a/src/routes/stocks/[tickerID]/ai-analysis/+page.svelte b/src/routes/stocks/[tickerID]/ai-analysis/+page.svelte deleted file mode 100644 index ff8aebc5..00000000 --- a/src/routes/stocks/[tickerID]/ai-analysis/+page.svelte +++ /dev/null @@ -1,764 +0,0 @@ - - - - - - - - - - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} {$displayCompanyName} ({$stockTicker}) Options Activity · stocknear - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-

- Unsual Options Activity -

- -
- - - {#if optionsPlotData?.length !== 0} - 1 Year of options activity involving {$displayCompanyName} by major institutional traders and hedge funds. - {:else} - There's no data available, indicating that major traders may not be actively betting on {$displayCompanyName}. - {/if} - -
- -
- - - {#if optionsPlotData?.length !== 0} - -
-
- - -
- {displayTotalVolume} -
-
-
- -
- {displayTotalOpenInterest} -
-
-
- -
- {putCallRatio !== 'Infinity' ? putCallRatio : '> 1'} -
-
-
- - -
- {putCallOpenInterestRatio !== 'Infinity' ? putCallOpenInterestRatio : '> 1'} -
-
-
- -
- - - - -
- - - - -
- {#if filteredList?.length !== 0} - - {:else} - -
- - No Options activity found -
-
- {/if} -
- - - -

- Latest Options Activity -

- - - - {#if optionList?.length !== 0} - - -
-
- -
-
- Flow Sentiment - {flowSentiment} -
- -
- - -
-
- Put/Call - - {latestPutCallRatio?.toFixed(3)} - -
- -
- - - - - - =1 ? 0 : 100-(latestPutCallRatio*100)?.toFixed(2)}> - - - -
- {latestPutCallRatio?.toFixed(2)} -
-
- - -
- - -
-
- Call Flow - - {new Intl.NumberFormat("en", { - minimumFractionDigits: 0, - maximumFractionDigits: 0 - }).format(displayCallVolume)} - -
- -
- - - - - - - - - -
- {callPercentage}% -
-
- -
- - -
-
- Put Flow - - {new Intl.NumberFormat("en", { - minimumFractionDigits: 0, - maximumFractionDigits: 0 - }).format(displayPutVolume)} - -
- -
- - - - - - - - - -
- {putPercentage}% -
-
- - -
- - - -
-
- OTM Ratio - - Volume in % - -
- -
- - - - - - =1 ? 0 : 100-(displayOTMRatio*100)?.toFixed(2)}> - - - -
- {(displayOTMRatio*100)?.toFixed(0)}% -
-
- - -
- - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - {#each (data?.user?.tier === 'Pro' ? optionList : optionList?.slice(0,3)) as item, index} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/each} - - -
TimeDateExpiryStrikeC/PSent.SpotPricePrem.TypeVol.OI
- {formatTime(item?.time)} - - {formatDate(item?.date)} - - {item?.dte < 0 ? 'expired' : item?.dte +'d'} - - {item?.strike_price} - - {item?.put_call} - - {item?.sentiment} - - {item?.underlying_price} - - {item?.price} - - {abbreviateNumber(item?.cost_basis)} - - {item?.type} - - {new Intl.NumberFormat("en", { - minimumFractionDigits: 0, - maximumFractionDigits: 0 - }).format(item?.volume)} - - {new Intl.NumberFormat("en", { - minimumFractionDigits: 0, - maximumFractionDigits: 0 - }).format(item?.open_interest)} -
- -
- - - - {:else} -
-
- - No Options activity found -
-
- {/if} - - {/if} - - - - -
- - -
-
- - -
- - - - - \ No newline at end of file diff --git a/src/routes/stocks/[tickerID]/ai-analysis/+page.ts b/src/routes/stocks/[tickerID]/ai-analysis/+page.ts deleted file mode 100644 index 2cad2a5f..00000000 --- a/src/routes/stocks/[tickerID]/ai-analysis/+page.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { getCache, setCache } from '$lib/store'; - - -function daysLeft(targetDate) { - const targetTime = new Date(targetDate).getTime(); - const currentTime = new Date().getTime(); - const difference = targetTime - currentTime; - - const millisecondsPerDay = 1000 * 60 * 60 * 24; - const daysLeft = Math?.ceil(difference / millisecondsPerDay); - - return daysLeft; -} - - -export const load = async ({ parent, params }) => { - - - const {apiKey, apiURL} = await parent(); - - - const getOptionsPlotData = async () => { - - const cachedData = getCache(params.tickerID, 'getOptionsPlotData'); - if (cachedData) { - return cachedData; - } else { - - const postData = { - ticker: params.tickerID - }; - - const response = await fetch(apiURL + '/options-plot-ticker', { - method: 'POST', - headers: { - "Content-Type": "application/json", "X-API-KEY": apiKey - }, - body: JSON.stringify(postData) - }); - - const output = await response.json(); - - setCache(params.tickerID, output, 'getOptionsPlotData'); - return output; - - } - - }; - - const getOptionsFlowData = async () => { - - let output; - const cachedData = getCache(params.tickerID, 'getOptionsFlowData'); - if (cachedData) { - output = cachedData; - } else { - - const postData = { - ticker: params.tickerID - }; - - // make the POST request to the endpoint - const response = await fetch(apiURL + '/options-flow-ticker', { - method: 'POST', - headers: { - "Content-Type": "application/json", "X-API-KEY": apiKey - }, - body: JSON.stringify(postData) - }); - - output = await response.json(); - - output?.forEach(item => { - item.dte = daysLeft(item?.date_expiration); - }); - - setCache(params.tickerID, output, 'getOptionsFlowData'); - } - - return output; - }; - - // Make sure to return a promise - return { - getOptionsPlotData: await getOptionsPlotData(), - getOptionsFlowData: await getOptionsFlowData() - }; - -};