The major averages are rallying to end 2023, but not all stocks can be winners. Investor optimism over a more dovish Fed has spurred a surge in stock prices since late October, with all three major indexes most recently notching eight straight weeks of gains. The Nasdaq 100 benchmark has soared to new heights, closing at a new record high on Tuesday. The index’s year-to-date gains are now an eye-watering 54%. Even as the index is tracking for a strong finish to 2023, 17 stocks are so far slated to end the year in the negative. Moderna , down about 45% so far this year, leads these losses. Waning Covid vaccine demand has contributed to Moderna’s plummet this year. But shares of the biopharmaceutical company popped 28% this month after midstage trial data revealed its cancer vaccine, developed with Merck , reduced the risk of death or relapse when used with Keytruda in patients with skin cancer. Analysts covering the stock are fairly optimistic, according to FactSet. Nearly 38% of analysts have assigned a buy rating to Moderna, with an average upside potential of 28.7%. Biotech stock Illumina , down 30% this year, is the second-largest loser in the Nasdaq 100. While the stock recently popped after Illumina announced plans to sell its Grail unit, that’s not enough to counter other hurdles facing the company. “ILMN has struggled to grow revenues over the past 4 years, and we see no imminent fix to a myriad of challenges facing the business,” wrote Bank of America analyst Michael Ryskin. Earlier this month, the bank downgraded Illumina stock to an underperform rating, despite still naming the company as the “dominant market leader in DNA sequencing.” Ryskin, however, noted that he sees no indication of a “quick fix on the horizon” for the company’s stagnant revenue. Analysts polled by FactSet seem to agree with his assessment. While 52% of analysts covering Illumina have assigned it a buy rating, the average price target indicates a potential 1.9% decline from the stock’s current trading price. Utility company Exelon has slumped 18% this year, plagued by an unfavorable rate case decision in Illinois that resulted in the company having one of the lowest returns on equity in the industry, at 8.91%. As a result, Morgan Stanley downgraded the stock to equal weight from overweight. However, Morgan Stanley analyst David Arcaro’s price target of $38, down from $45, implies that the stock could still rise 7% from Tuesday’s close. FactSet data indicates that just 21% of analysts covering the company have a buy rating assigned, and the average upside comes out to 12.8%. Arcaro underscored favorable characteristics such as attractive growth opportunities and low earnings risk in Exelon’s remaining business. But he added that “elevated concern around its largest utility will be an overhang on the stock well into 2024.” Another stock that has missed out on the 2023 rally is PayPal . Shares of the financial technology company have dipped about 12% in 2023. Bank of America recently downgraded the stock to a neutral rating from buy, accompanying the move by decreasing its price target to $66 from $77. That implies about 5.5% upside from Tuesday’s close. Analyst Jason Kupferberg wrote that investors will have to practice patience ahead of a pivotal year for the stock. “Shares have traded up from lows following PYPL’s modest 3Q beat and new CEO Alex Chriss’ fresh messaging around profitable growth and increased urgency around execution. However, we see ’24 as a transition year, as a new CEO/CFO seek to earn Street credibility while driving sustained improvements in top-line metrics,” he wrote. More than half of analysts surveyed by FactSet had a buy rating on the name, and the average consensus price target suggests upside of 18.3%. – CNBC’s Michael Bloom contributed reporting.