diff --git a/src/routes/stock-screener/+page.server.ts b/src/routes/stock-screener/+page.server.ts index ac4d6ed8..4fb7ba86 100644 --- a/src/routes/stock-screener/+page.server.ts +++ b/src/routes/stock-screener/+page.server.ts @@ -4,12 +4,6 @@ import { loginUserSchema, registerUserSchema } from "$lib/schemas"; -export const load = async ({ locals}) => { - - if (!locals.pb.authStore.isValid) { - redirect(303, '/stock-screener/demo'); - } -}; export const actions = { @@ -91,7 +85,7 @@ export const actions = { - oauth2: async ( { url, locals, request, cookies }) => { + oauth2: async ( { url, locals, request, cookies }) => { const authMethods = await locals?.pb?.collection('users')?.listAuthMethods(); const data = await request?.formData(); @@ -137,10 +131,10 @@ export const actions = { }); - redirect(302,authProviderRedirect); } + }; diff --git a/src/routes/stock-screener/+page.svelte b/src/routes/stock-screener/+page.svelte index f68affab..d73bab42 100644 --- a/src/routes/stock-screener/+page.svelte +++ b/src/routes/stock-screener/+page.svelte @@ -1,38 +1,254 @@ + - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Free Stock Screener - Search, Filter and Analyze Stocks · stocknear - - - - - - - - - - - - - - - + + + + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Stock Screener · stocknear + + + + + + + + + + + + + + + - - - - - -
- - - - -
-
- - -
-
-

- Stock Screener -

-
- - - - + + -
- - - - - + + + + + + +
+ +
+
+

+ Stock Screener +

+ + {filteredData?.length} Matches Found + +
+ +
+ +
+ +
+ + + + + + + Popular Strategies + + + + popularStrategy('dividendGrowth')} class="cursor-pointer hover:bg-[#27272A]"> + Dividend Growth + + popularStrategy('topGainers1Y')} class="cursor-pointer hover:bg-[#27272A]"> + Top Gainers 1Y + + popularStrategy('topShortedStocks')} class="cursor-pointer hover:bg-[#27272A]"> + Top Shorted Stocks + + popularStrategy('topAIStocks')} class="cursor-pointer hover:bg-[#27272A]"> + Best AI Forecast + + popularStrategy('momentumTAStocks')} class="cursor-pointer hover:bg-[#27272A]"> + Momentum TA Stocks + + popularStrategy('underValuedStocks')} class="cursor-pointer hover:bg-[#27272A]"> + Undervalued Stocks + + popularStrategy('strongCashFlow')} class="cursor-pointer hover:bg-[#27272A]"> + Strong Cash Flow + + + + - + +
+
+ +
+ +
+ + + + + + + + + + + + + {#each strategyList as item} + selectedStrategy = item?.id} class="cursor-pointer sm:hover:bg-[#27272A]"> + {item?.title} + + {/each} + + + + + +
+
+ + +
+ + +
+ + +
+
+
+ +
+
+ {#if showFilters} +
+ + + + {#if data?.user && selectedStrategy?.length !== 0} + + {/if} + + {#if ruleOfList?.length !== 0} + + {/if} + + +
+ + +
+ {#each displayRules as row (row?.rule)} + +
+
+ {row?.label?.replace('[%]','')} +
+
+ +
+
ruleName = row?.rule}> + + + + + + {#if !['sma20','sma50','sma100','sma200','ema20', 'ema50', 'ema100', 'ema200', 'analystRating','sector','industry','country']?.includes(row?.rule)} + +
+
+ + +
+
+
+ {:else} + + {/if} + + {#if !['sma20','sma50','sma100','sma200','ema20', 'ema50', 'ema100', 'ema200', 'analystRating','sector','industry','country']?.includes(row?.rule)} + {#each row?.step as newValue} + + + + + {/each} + {:else if ['sma20','sma50','sma100','sma200','ema20', 'ema50', 'ema100', 'ema200']?.includes(row?.rule)} + {#each row?.step as item} + +
event.preventDefault()}> + +
+
+ {/each} + {:else} + {#each (testList.length > 0 && searchQuery?.length > 0 ? testList : searchQuery?.length > 0 && testList?.length === 0 ? [] : (row?.rule === 'country' ? listOfRelevantCountries : row?.rule === 'sector' ? sectorList : row?.rule === 'industry' ? industryList : ['Buy','Hold','Sell'])) as item} + +
event.preventDefault()}> + +
+
+ {/each} + + {/if} +
+
+
+
+
+
+
+ + {/each} +
+ {/if} + + +
+ + + + + + + + +
+ + + + + + +
+

+ {filteredData?.length} Stocks +

+
+ +
+
+ + + {#if isLoaded} + {#if filteredData?.length !== 0} + {#if displayTableTab === 'general'} +
+ + + + + + + + + + + + + + {#each displayResults as item} + + + + + + + + + + + + + + + + + + {/each} + +
Symbol { sortBy = 'marketCap'; changeOrder(order); }} class="whitespace-nowrap cursor-pointer text-white font-semibold text-sm sm:text-[1rem] font-semibold text-end"> + Market Cap + + { sortBy = 'change'; changeOrder(order); }} class="whitespace-nowrap cursor-pointer text-white font-semibold text-sm sm:text-[1rem] font-semibold text-end"> + % Change + + + Price + { sortBy = 'volume'; changeOrder(order); }} class="whitespace-nowrap cursor-pointer text-white font-semibold text-sm sm:text-[1rem] font-semibold text-end"> + Volume + + { sortBy = 'pe'; changeOrder(order); }} class="whitespace-nowrap cursor-pointer text-white font-semibold text-sm sm:text-[1rem] font-semibold text-end"> + PE Ratio + +
+
+ handleSave(false)} class="sm:hover:text-white text-blue-400 text-sm sm:text-[1rem]">{item?.symbol} + {item?.name?.length > charNumber ? item?.name?.slice(0,charNumber) + "..." : item?.name} +
+ +
+ {#if item?.symbol?.includes('.DE') || item?.symbol?.includes('.F')} + €{item?.marketCap < 100 ? '< $100' : abbreviateNumber(item?.marketCap)} + {:else} + {item?.marketCap < 100 ? '< $100' : abbreviateNumber(item?.marketCap,true)} + {/if} + + {#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?.price < 0.01 ? '< $0.01' : item?.price?.toFixed(2)} + + {item?.volume === 0 ? '-' : abbreviateNumber(item?.volume)} + + {item?.pe?.toFixed(2)} +
+
+ {:else if displayTableTab === 'filters'} +
+ + + + + + + {#each displayRules as row (row?.rule)} + {#if row?.rule !== 'marketCap'} + + {/if} + {/each} + + + + {#each displayResults as item (item?.symbol)} + {handleSave(false); goto("/stocks/"+item?.symbol)}} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] bg-[#09090B] border-b-[#09090B] odd:bg-[#27272A] cursor-pointer"> + + + + {#each displayRules as row (row?.rule)} + {#if row?.rule !== 'marketCap'} + + {/if} + {/each} + + {/each} + +
SymbolMarket Cap{row?.label}
+
+ {item?.symbol} + {item?.name?.length > charNumber ? item?.name?.slice(0, charNumber) + "..." : item?.name} +
+
+ {abbreviateNumber(item?.marketCap, true)} + + {#if ['ema20', 'ema50', 'ema100', 'ema200', 'analystRating','sector','industry','country','analystRating']?.includes(row?.rule)} + {item[row?.rule]} + {:else if ['fundamentalAnalysis','trendAnalysis']?.includes(row?.rule)} + {item[row?.rule]?.accuracy}% + {:else} + {abbreviateNumber(item[row?.rule])} + {/if} +
+ +
+ {/if} + {:else} +
+ + Looks like your taste is one-of-a-kind! No matches found... yet! +
+ {/if} + {:else} +
+
+ +
+
+ {/if} + + + + + + +
+ + + + + + + + + + + + - {#if isLoaded} - {#if strategyList?.length === 0} -
- No strategies available -
- {:else} - - - -
- {#each strategyList as item, index} -
-
- - -
- Last updated - - {formatDate(item?.updated)} ago - -
-
-
- -
-
- Title - - {item?.title} - -
- -
- Total Rules - - {item?.rules?.length} - -
-
- -
+ - - {/if} - {:else} -
-
-
-
- {/if} -
-
-
- + +
e?.key === 'Enter' ? e.preventDefault() : '' }> + +
+
+ +
+
-
+ + + +
+ +
+ + {#if searchTerm?.length !== 0 && filteredRows?.length === 0} + + Nothing Found + + {:else} + + + + + {#each (searchTerm?.length !== 0 ? filteredRows : allRows) as row, index} + changeRule(row?.rule)} class="sm:hover:bg-[#333333] cursor-pointer"> + + + + + {/each} + + +
{index+1} + {#if ruleOfList.find((rule) => rule?.name === row?.rule)} + + {/if} + {row?.label}
+ {/if} +
- - - - - - - - - - - - - - + +
+ + +
+
+ + + @@ -569,44 +1483,6 @@ onMount(async () => { - - - - - - - - - - - - - - - - - - @@ -616,7 +1492,7 @@ onMount(async () => { -