CEO of Apple Tim Cook attends the 2022 Vanity Fair Oscar Party following the 94th Oscars at the The Wallis Annenberg Center for the Performing Arts in Beverly Hills, California on March 27, 2022.CEO of Apple Tim Cook attends the 2022 Vanity Fair Oscar Party following the 94th Oscars at the The Wallis Annenberg Center for the Performing Arts in Beverly Hills, California on March 27, 2022.

Apple is on track to close higher for an 11th day in a row, which would be the longest winning streak of the iPhone era.

The company's stock was up more than 1% as of mid-day, wiping out its losses for the year. Apple's market cap hit $3 trillion on Jan. 3, but it is still 2.8% off its record. Apple was worth over $2 trillion as of Tuesday.

The last time Apple's stock gained for at least 11 days in a row was in 2003 when the company's fastest-growing product was the iPod music player. The first iPhone was released in 2007.

Apple's rally comes alongside a broader market gain, with investors becoming more optimistic about ceasefire negotiations between Russia and Ukraine. Apple's Big Tech peers gained on Tuesday, as Meta, Amazon, Netflix and Alphabet all advanced.

Apple is a bedrock of strength and demand for services is helping the stock to power back towards the $3 trillion area code, according to an email from an analyst.

The big established names have held up better than the emerging companies this year. With inflation rising at the fastest pace in 40 years and the Federal Reserve hiking interest rates, investors are putting their money in less-risky assets.

The Fed's rate liftoff was a bright green light to own tech stocks and many investors were caught off guard.

The company was facing some challenges this week, as it was reported that it was scaling back production of the new budget phone. Apple's leadership has been able to navigate choppy waters.

"Tim Cook just continues to execute with their team", said Bryn Talkington of Requisite Capital Management. It has done well, it has held up better than the majority of tech stocks, so I think it will continue to do that.

You can subscribe to CNBC on the internet.

Gene Munster says he is still very bullish on Apple.