The stock market ended a tumultuous week on a turbulent note, with the Dow trading in a 900-point range before finishing sharply higher on the day. Major benchmarks struggled to find a lasting direction until the final hour of trading as various cross-currents rippled throughout the financial markets, including a drop in crude oil below the $59-per-barrel mark and the easing of bond yields. Yet amid the chaos, some stocks posted very good gains. FireEye (MNDT), Wesco Aircraft Holdings (WAIR), and Mattel (MAT -0.91%) were among the best performers on the day. Below, we'll look more closely at these stocks to tell you why they did so well.

FireEye heats up

Shares of FireEye gained 9% after the company reported its fourth-quarter financial results late Thursday. The cybersecurity specialist posted adjusted earnings of just $0.01 per share, but that was enough to give FireEye its first quarterly profit in history, and CEO Kevin Mandia celebrated success in all of the company's regions and product groups. Outlooks for 2018 were also favorable, including expectations for a full-year profit. Given the increasing need for secure digital interaction, FireEye's targetable market will only grow larger in the years to come, and that gives the company a huge opportunity.

FireEye logo of the left half of an eye in black and a right half of a flame in red.

Image source: FireEye.

Wesco soars higher

Wesco Aircraft Holdings stock climbed into the stratosphere, jumping 28% after the company released its fiscal first-quarter financial report. Wesco reported solid sales growth of 7% and a modest profit, saying that the rise in the top line came from higher volumes on hardware and chemical contracts. The aerospace supply chain management specialist also pointed to the results of a recent assessment of its business, which identified opportunities to cut internal expenses in order to boost profits. The move came as a nice counterpoint to last quarter's earnings-related dive, but Wesco needs to find some consistency in order to satisfy long-term investors.

Mattel names a new chair

Finally, shares of Mattel picked up 8%. The ailing toy company named Ynon Kreiz as its incoming non-executive chair of its board of directors, taking the place of former CEO Christopher Sinclair, who said back in June that he would resign as of the annual stockholder meeting in 2018. Kreiz has considerable experience in the entertainment and media space, especially in the digital arena. That could be a prospective growth area for Mattel as it searches for better ways to monetize its popular brand names more effectively. Investors seem excited that Kreiz will work well with current CEO Margo Georgiadis to mount a strong comeback for Mattel.