diff --git a/src/routes/stock-screener/[strategyId]/+page.svelte b/src/routes/stock-screener/[strategyId]/+page.svelte index e8a9c096..fa1d91e8 100644 --- a/src/routes/stock-screener/[strategyId]/+page.svelte +++ b/src/routes/stock-screener/[strategyId]/+page.svelte @@ -128,12 +128,12 @@ const getStockScreenerData = async (rules) => { let allRows = [ - { rule: 'avgVolume', label: 'Avg Volume', category: 'fund' }, - { rule: 'rsi', label: 'Relative Strength Index (RSI)',category: 'ta' }, - { rule: 'stochRSI', label: 'Stochastic RSI Fast',category: 'ta' }, - { rule: 'mfi', label: 'Money Flow Index',category: 'ta' }, - { rule: 'cci', label: 'Commodity Channel Index',category: 'ta' }, - { rule: 'atr', label: 'Average True Range (ATR)',category: 'ta' }, + { rule: 'avgVolume', label: 'Avg Volume', max: "50", min:"1", step:"0.5", unit: 'Mio', category: 'fund' }, + { rule: 'rsi', label: 'RSI', max: "100", min:"0", step:"2", category: 'ta' }, + { rule: 'stochRSI', label: 'Stoch RSI Fast', max: "100", min:"0", step:"2",category: 'ta' }, + { rule: 'mfi', label: 'MFI', max: "100", min:"0", step:"2", category: 'ta' }, + { rule: 'cci', label: 'CCI', max: "300", min:"-300", step:"10",category: 'ta' }, + { rule: 'atr', label: 'ATR', max: "20", min:"0", step:"0.5",category: 'ta' }, { rule: 'sma50', label: 'SMA-50', max: "500", min:"0", step:"10", category: 'ta' }, { rule: 'sma200', label: 'SMA-200', max: "500", min:"0", step:"10", category: 'ta' }, { rule: 'ema50', label: 'EMA-50', max: "500", min:"0", step:"10", category: 'ta' }, @@ -155,43 +155,42 @@ const getStockScreenerData = async (rules) => { { rule: 'growthNetIncome', label: 'Net Income Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund'}, { rule: 'grossProfit', label: 'Gross Profit', max: "800", min:"-100", step:"10", unit: 'Bn', category: 'fund'}, { rule: 'growthGrossProfit', label: 'Gross Profit Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund'}, - { rule: 'researchAndDevelopmentExpenses', label: 'Research & Development (R&D) Expenses', category: 'fund'}, + { rule: 'researchAndDevelopmentExpenses', label: 'R&D Expenses', max: "100", min:"0", step:"1", unit: 'Bn', category: 'fund'}, { rule: 'growthResearchAndDevelopmentExpenses', label: 'R&D Expenses Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund'}, - { rule: 'payoutRatio', label: 'Payout Ratio [%]',category: 'fund' }, - { rule: 'dividendYield', label: 'Dividend Yield [%]',category: 'fund' }, - { rule: 'annualDividend', label: 'Annual Dividend',category: 'fund' }, - { rule: 'dividendGrowth', label: 'Dividend Growth [%]',category: 'fund' }, + { rule: 'payoutRatio', label: 'Payout Ratio [%]', max: "100", min:"-100", step:"1", unit: '%', category: 'fund' }, + { rule: 'dividendYield', label: 'Dividend Yield [%]', max: "100", min:"0", step:"1", unit: '%',category: 'fund' }, + { rule: 'annualDividend', label: 'Annual Dividend', max: "20", min:"0", step:"0.5", category: 'fund' }, + { rule: 'dividendGrowth', label: 'Dividend Growth [%]', max: "100", min:"-100", step:"2", unit: '%',category: 'fund' }, { rule: 'eps', label: 'EPS', max: "10", min:"-10", step:"0.1", category: 'fund' }, { rule: 'growthEPS', label: 'EPS Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund' }, - { rule: 'interestIncome', label: 'Interest Income',category: 'fund' }, + { rule: 'interestIncome', label: 'Interest Income', max: "800", min:"-100", step:"10", unit: 'Bn', category: 'fund' }, { rule: 'interestExpense', label: 'Interest Expenses', category: 'fund' }, { rule: 'growthInterestExpense', label: 'Interest Expenses Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund' }, - { rule: 'operatingExpenses', label: 'Operating Expenses',category: 'fund' }, + { rule: 'operatingExpenses', label: 'Operating Expenses', max: "800", min:"-100", step:"10", unit: 'Bn', category: 'fund' }, { rule: 'growthOperatingExpenses', label: 'Operating Expenses Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund' }, - { rule: 'operatingIncome', label: 'Operating Income',category: 'fund' }, + { rule: 'operatingIncome', label: 'Operating Income', max: "800", min:"-100", step:"10", unit: 'Bn', category: 'fund' }, { rule: 'growthOperatingIncome', label: 'Operating Income Growth [%]', max: "200", min:"-100", step:"2", unit: '%',category: 'fund' }, - { rule: 'pe', label: 'Price per Earnings (PE)', category: 'fund'}, - { rule: 'forwardPE', label: 'Forward PE', category: 'fund'}, - { rule: 'priceToBookRatio', label: 'Price to Book Ratio (PB)', category: 'fund'}, - { rule: 'priceToSalesRatio', label: 'Price to Sales Ratio (PS)', category: 'fund'}, - { rule: 'beta', label: 'Beta', category: 'fund'}, - { rule: 'ebitda', label: 'Earnings Before Interests, Taxes, Depreciation & Amortisation (EBITDA)', category: 'fund'}, + { rule: 'pe', label: 'P/E', max: "50", min:"0", step:"0.5",category: 'fund'}, + { rule: 'forwardPE', label: 'Forward PE', max: "100", min:"-100", step:"2", category: 'fund'}, + { rule: 'priceToBookRatio', label: 'P/B', max: "50", min:"0", step:"0.5", category: 'fund'}, + { rule: 'priceToSalesRatio', label: 'P/S', max: "50", min:"0", step:"0.5", category: 'fund'}, + { rule: 'beta', label: 'Beta', max: "10", min:"-10", step:"0.1", category: 'fund'}, + { rule: 'ebitda', label: 'EBITDA', max: "800", min:"-100", step:"10", unit: 'Bn', category: 'fund'}, { rule: 'growthEBITDA', label: 'EBITDA Growth [%]', max: "200", min:"-100", step:"2", unit: '%', category: 'fund'}, - { rule: 'var', label: 'Value at Risk (VaR)', category: 'fund' }, - { rule: 'trendAnalysis', label: 'AI Trend Analysis (Bullish)', category: 'ai' }, - { rule: 'fundamentalAnalysis', label: 'AI Fundamental Analysis (Bullish)', category: 'ai' }, - { rule: 'ratingRecommendation', label: 'Analyst Rating', category: 'fund'}, - { rule: 'currentRatio', label: 'Current Ratio',category: 'fund' }, - { rule: 'quickRatio', label: 'Quick Ratio',category: 'fund' }, - { rule: 'debtEquityRatio', label: 'Debt / Equity',category: 'fund' }, - { rule: 'debtRatio', label: 'Debt Ratio',category: 'fund' }, - { rule: 'returnOnAssets', label: 'Return on Assets',category: 'fund' }, - { rule: 'returnOnEquity', label: 'Return on Equity',category: 'fund' }, + { rule: 'var', label: 'VaR', max: "0", min:"-20", step:"1", unit: '%', category: 'fund' }, + { rule: 'trendAnalysis', label: 'AI Trend Analysis (Bullish)', max: "100", min:"0", step:"0.5", unit: '%', category: 'ai' }, + { rule: 'fundamentalAnalysis', label: 'AI Fundamental Analysis (Bullish)', max: "100", min:"0", step:"0.5", unit: '%', category: 'ai' }, + //{ rule: 'ratingRecommendation', label: 'Analyst Rating', max: "2", min:"0", step:"1", category: 'fund'}, + { rule: 'currentRatio', label: 'Current Ratio', max: "50", min:"0", step:"0.5", category: 'fund' }, + { rule: 'quickRatio', label: 'Quick Ratio', max: "50", min:"0", step:"0.5", category: 'fund' }, + { rule: 'debtEquityRatio', label: 'Debt / Equity', max: "50", min:"0", step:"0.5",category: 'fund' }, + { rule: 'debtRatio', label: 'Debt Ratio', max: "50", min:"0", step:"0.5", category: 'fund' }, + { rule: 'returnOnAssets', label: 'Return on Assets', max: "5", min:"-5", step:"0.1", category: 'fund' }, + { rule: 'returnOnEquity', label: 'Return on Equity', max: "5", min:"-5", step:"0.1",category: 'fund' }, { rule: 'enterpriseValue', label: 'Enterprise Value', max: "800", min:"10", step:"10", unit: 'Bn', category: 'fund' }, { rule: 'freeCashFlowPerShare', label: 'FCF / Share', max: "20", min:"-20", step:"0.5",category: 'fund' }, { rule: 'cashPerShare', label: 'Cash / Share', max: "50", min:"-50", step:"1", category: 'fund' }, { rule: 'priceToFreeCashFlowsRatio', label: 'Price / FCF', max: "100", min:"-100", step:"2", category: 'fund' }, - ]; // Creating the ruleMappings object from allRows @@ -429,10 +428,16 @@ const conditions = { var: ruleCondition.var, trendAnalysis: ruleCondition.trendAnalysis, fundamentalAnalysis: ruleCondition.fundamentalAnalysis, + dividendGrowth: ruleCondition.dividendGrowth, + dividendYield: ruleCondition.dividendYield, + payoutRatio: ruleCondition.payoutRatio, + annualDividend: ruleCondition.annualDividend, currentRatio: ruleCondition.currentRatio, quickRatio: ruleCondition.quickRatio, debtEquityRatio: ruleCondition.debtEquityRatio, debtRatio: ruleCondition.debtRatio, + returnOnAssets: ruleCondition.returnOnAssets, + returnOnEquity: ruleCondition.returnOnEquity, enterpriseValue: ruleCondition.enterpriseValue, freeCashFlowPerShare: ruleCondition.freeCashFlowPerShare, cashPerShare: ruleCondition.cashPerShare, @@ -863,7 +868,7 @@ function handleChangeValue(event) { // If you need to keep the separate variables in sync: switch (rule) { case 'payoutRatio': - valuePayoutRatio; + valuePayoutRatio = value; break; case 'dividendGrowth': valueDividendGrowth = value; @@ -902,7 +907,7 @@ function handleChangeValue(event) { valueInterestIncome = value; break; case 'ratingRecommendation': - valueAnalyst //ruleTrend[ruleName] = value; + valueAnalyst = value; break; case 'revenue': valueRevenue = value; @@ -1139,795 +1144,25 @@ function handleChangeValue(event) {
- + {#if allRows.some(row => row.rule === ruleName)} + {#each allRows as row (row.rule)} + {#if ruleName === row.rule} + + {/if} + {/each} + {/if} - - {#if ruleName === 'trendAnalysis'} - -
- AI Trend Analysis (Bullish) {ruleCondition[ruleName]} {valueTrendAnalysis}% - - - -
- -
- -
- - {/if} - - - - {#if ruleName === 'fundamentalAnalysis'} - -
- AI Fund. Analysis (Bullish) {ruleCondition[ruleName]} {valueFundamentalAnalysis}% - - - -
- -
- -
- - {/if} - - - - - - - {#if ruleName === 'researchAndDevelopmentExpenses'} - -
- R&D Expenses {ruleCondition[ruleName]} ${valueResearchAndDevelopmentExpenses} Bn - - - - -
- - -
- - -
- - {/if} - - - - - - - - {#if ruleName === 'interestIncome'} - -
- Interest Income {ruleCondition[ruleName]} ${valueInterestIncome === 1000 ? `${valueInterestIncome / 1000} Bn` : `${valueInterestIncome} Mio`} - - - - -
- - -
- - -
- - {/if} - - - - - {#if ruleName === 'interestExpense'} - -
- Interest Expenses {ruleCondition[ruleName]} ${valueInterestExpenses === 1000 ? `${valueInterestExpenses / 1000} Bn` : `${valueInterestExpenses} Mio`} - - - -
- -
- -
- {/if} - - - - - {#if ruleName === 'avgVolume'} - -
- Avg. Volume {ruleCondition[ruleName]} {valueAvgVolume} Mio - - - -
- -
- -
- {/if} - - - - - - - - {#if ruleName === 'operatingExpenses'} - -
- Operating Expenses {ruleCondition[ruleName]} ${valueOperatingExpenses} Bn - - - -
- -
- -
- {/if} - - - - - - - - - {#if ruleName === 'operatingIncome'} - -
- Operating Income {ruleCondition[ruleName]} ${valueOperatingIncome} Bn - - - -
- -
- -
- {/if} - - - - - - {#if ruleName === 'ratingRecommendation'} - -
- Analyst Rating: - {#if ruleTrend[ruleName] === 'Hold'} - {ruleTrend[ruleName]} - {:else if ruleTrend[ruleName].includes('Buy')} - {ruleTrend[ruleName]} - {:else if ruleTrend[ruleName].includes('Sell')} - {ruleTrend[ruleName]} - {/if} -
- - - -
- - -
- - {/if} - - - - - {#if ruleName === 'currentRatio'} - -
- Current Ratio {ruleCondition[ruleName]} {valueCurrentRatio} - - - - -
- - -
- - -
- - {/if} - - {#if ruleName === 'quickRatio'} - -
- Quick Ratio {ruleCondition[ruleName]} {valueQuickRatio} - - - - -
- - -
- - -
- - {/if} - - {#if ruleName === 'returnOnAssets'} - -
- Return on Assets {ruleCondition[ruleName]} {valueReturnOnAssets} - - - - -
- - -
- - -
- - {/if} - - - {#if ruleName === 'returnOnEquity'} - -
- Return on Equity {ruleCondition[ruleName]} {valueReturnOnEquity} - - - - -
- - -
- - -
- - {/if} - - {#if ruleName === 'debtRatio'} - -
- Debt Ratio {ruleCondition[ruleName]} {valueDebtRatio} - - - - -
- - -
- - -
- - {/if} - - - {#if ruleName === 'debtEquityRatio'} - -
- Debt Equity Ratio {ruleCondition[ruleName]} {valueDebtEquityRatio} - - - - -
- - -
- - -
- - {/if} - - - {#if ruleName === 'payoutRatio'} - -
- Dividend Growth {ruleCondition[ruleName]} {valuePayoutRatio}% - - - - -
- - -
- - -
- - {/if} - - - - {#if ruleName === 'dividendGrowth'} - -
- Dividend Growth {ruleCondition[ruleName]} {valueDividendGrowth}% - - - - -
- - -
- - -
- - {/if} - - - - - {#if ruleName === 'dividendYield'} - -
- Dividend Yield {ruleCondition[ruleName]} {valueDividendYield}% - - - - -
- - -
- - -
- - {/if} - - - - - {#if ruleName === 'annualDividend'} - -
- Annual Dividend {ruleCondition[ruleName]} ${valueAnnualDividend} - - - - -
- - -
- - -
- - {/if} - - - - - {#if ruleName === 'pe'} -
- PE Ratio {ruleCondition[ruleName]} {valuePE} - - - - -
- -
- - -
- - {/if} - - - - {#if ruleName === 'forwardPE'} -
- Forward PE {ruleCondition[ruleName]} {valueForwardPE} - - - - -
- -
- - -
- - {/if} - - - - {#if ruleName === 'priceToBookRatio'} -
- PB Ratio {ruleCondition[ruleName]} {valuePriceToBookRatio} - - - - -
- -
- - -
- - {/if} - - - - {#if ruleName === 'priceToSalesRatio'} -
- PS Ratio {ruleCondition[ruleName]} {valuePriceToSalesRatio} - - - - -
- -
- - -
- - {/if} - - - - {#if ruleName === 'var'} - - -
- VaR {ruleCondition[ruleName]} {valueVaR}% - - - - -
- - -
- - -
- {/if} - - - - {#if ruleName === 'beta'} - -
- Beta {ruleCondition[ruleName]} {valueBeta} - - - -
-
- -
- {/if} - - - - {#if ruleName === 'ebitda'} -
- EBITDA {ruleCondition[ruleName]} ${valueEBITDA} Bn - - - - -
- -
- - -
- - {/if} - - - - - - - {#if ruleName === 'rsi'} -
- RSI {ruleCondition[ruleName]} {valueRSI} - - - -
- -
- -
- {/if} - - - - - {#if ruleName === 'stochRSI'} -
- Stoch RSI {ruleCondition[ruleName]} {valueStochRSI} - - - -
- -
- -
- {/if} - - - - - {#if ruleName === 'mfi'} -
- MFI {ruleCondition[ruleName]} {valueMFI} - - - -
- -
- -
- {/if} - - - - {#if ruleName === 'cci'} -
- CCI {ruleCondition[ruleName]} {valueCCI} - - - -
- -
- -
- {/if} - - - - {#if ruleName === 'atr'} -
- ATR {ruleCondition[ruleName]} {valueATR} - - - -
- -
- -
- {/if} - - - - - {#if allRows.some(row => row.rule === ruleName)} - {#each allRows as row (row.rule)} - {#if ruleName === row.rule} - - {/if} - {/each} - {/if} - - - - -