Shares of major solar companies are soaring into green territory on Tuesday as shipments begin ticking up and the Chinese-based renewable energy producers grow optimistic on the long term.

China-based Yingli Green Energy (YGE) jumped 31% following its preliminary financial results where it showed shipments falling by 6% to 7% in the fourth quarter, better than its previous guidance.

Shanghai-based JA Solar (JASO) climbed more than 10% as the company late Monday revealed a narrowed operating loss and a sharper-than-expected increase in shipments.

The surprise earnings and outlooks helped raise shares of the entire solar-panel renewable energy sector, with Suntech Power (STP) increasing by more than 13%, RenaSola (SOL) by more than 17% and Trina Solar (TSL) by more than 23%.

Shares of FirstSolar (FSLR), the largest of the solar companies with a market cap of nearly $5 billion, grew more than 3% to $56.61 in recent trade. 

"My suspicion is there is a short squeeze going on here – I get the sense short sellers are thinking the end of the solar downturn is finally approaching sooner than later," said Stephen Simko, a Morningstar analyst covering renewable energy. 

Solar stocks and renewable energy stocks often display volatility, moving up and down amid new regulation and swings in prices versus more traditional energy sources like oil and gas. 

However, FirstSolar's shares are up 79% from the beginning of January, pointing to a short squeeze as previously bearish investors unwind those earlier bets. 

Follow Jennifer Booton on Twitter at @Jbooton