bugfixing

This commit is contained in:
MuslemRahimi 2024-12-18 11:29:05 +01:00
parent 03ac4fe593
commit 0e7d4e9592
2 changed files with 10 additions and 11 deletions

View File

@ -7,20 +7,19 @@
export let data; export let data;
const excludedRules = new Set([ const excludedRules = new Set([
"volume",
"price",
"upside", "upside",
"priceTarget", "priceTarget",
"marketCap", "marketCap",
"changesPercentage", "analystCounter",
"analystRating"
]); ]);
const defaultList = [ const defaultList = [
{ name: "Ratings Count", rule: "counter" }, { name: "Analyst Count", rule: "analystCounter" },
{ name: "Price Target", rule: "priceTarget" },
{ name: "Price", rule: "price" },
{ name: "% Change", rule: "changesPercentage" },
{ name: "Upside", rule: "upside" }, { name: "Upside", rule: "upside" },
{ name: "Price Target", rule: "priceTarget" },
{ name: "Market Cap", rule: "marketCap" },
{name: 'Analyst Rating', rule: 'analystRating'}
]; ];
const hideLastRow = true; const hideLastRow = true;
</script> </script>
@ -30,7 +29,7 @@
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<title> <title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Top {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Top
100 Strong Buy Stocks · Stocknear Top Analyst Strong Buy Stocks · Stocknear
</title> </title>
<meta <meta
name="description" name="description"

View File

@ -96,7 +96,7 @@
}) })
?.slice(0, 30); //Consider only the last 30 ratings in the last 12 months ?.slice(0, 30); //Consider only the last 30 ratings in the last 12 months
const filteredAnalystCount = recentData.length; const filteredAnalystCount = recentData?.length;
const priceTargets = recentData const priceTargets = recentData
?.map((item) => parseFloat(item.adjusted_pt_current)) ?.map((item) => parseFloat(item.adjusted_pt_current))
?.filter((pt) => !isNaN(pt)); ?.filter((pt) => !isNaN(pt));
@ -110,10 +110,10 @@
priceTarget = medianPriceTarget; priceTarget = medianPriceTarget;
changesPercentage = changesPercentage =
medianPriceTarget !== "-" && data?.getStockQuote?.price != null medianPriceTarget !== "-" && data?.getStockQuote?.price != null
? ((medianPriceTarget / data.getStockQuote.price - 1) * 100).toFixed( ? ((medianPriceTarget / data?.getStockQuote.price - 1) * 100).toFixed(
2, 2,
) )
: "-"; : "n/a";
// Consensus rating calculation based on rating_current // Consensus rating calculation based on rating_current
const ratingScores = { const ratingScores = {