By the Numbers

Investors pile on record debt to buy stocks at record highs

Wdstock | E+ | Getty Images

With stocks near all-time highs, investors are taking on record levels of margin debt, something that could accelerate a decline if the market turns south.

Margin levels, or the amount borrowed to purchase securities, climbed to a new record of $401 billion in September, according to NYSE Euronext data released this week. The monthly increase of 4.78 percent was also the largest gain since January. The NYSE figures represent the margin accounts of member firms.

"Investors love going on margin in a rising market environment, but when the market declines, it can be extremely painful" says Paul Hickey, co-founder of Bespoke Investment Group. "Don't forget that if you go on margin you also have to pay interest on that loan, and some brokers charge pretty high rates, so you are already starting in the hole."

So far this year, the is up 23 percent, while other major indexes such as the NASDAQ and Dow Transports have spiked 30 percent and 32 percent, respectively.

Prior to the financial crisis, debt margins peaked at $381 billion in July, 2007, three months before the S&P 500 hit an all-time high.

Currently, the Federal Reserve's Regulation T allows investors to borrow up to 50 percent of the price of a securities purchased on margin. The Fed has not changed the margin requirements since 1974.

Even if high levels of margin sound alarming, they do not necessarily signal a red flag. Dan Greenhaus, Chief Global Strategist at BTIG, highlights that peaks in margin debt coincided with peaks in stock markets. "However, there's nothing to say that today, tomorrow or the next day is ultimately the peak. Like stock prices, we only know in hindsight," he said.

—BY CNBC's Giovanny Moreano and Pradip Sigdyal. Follow Giovanny on Twitter: @giovannymoreano