Updated

To cover the down payment required for a jumbo loan, some home buyers are borrowing money -- from themselves.

When buying a home in Avon, Conn., Matthew and Shannon Carbray decided to sell some of their stock holdings to make a down payment on a $1.02 million, five-bedroom property. But initially, they couldn't agree on the amount to put down.

Knowing that this is the home where the couple plans to stay and raise a family, Mr. Carbray, a 35-year-old managing partner at Avon-based Ridgeline Financial Partners, wanted to put down 20%, the minimum required down payment for most jumbo mortgages. He calculated that cash left in the stock market would make greater gains than the low cost of interest locked in for 30 years, and that interest also is tax-deductible, he says.

Ms. Carbray, a 32-year-old fixed-income portfolio manager at Hartford Investment Management Co., wanted to cash out more stock and put down 30% because she just felt more comfortable with lower monthly mortgage payments, Mr. Carbray says.

"I was looking at it mathematically and my wife was looking at it emotionally," he adds.

In the end, they compromised and put 25% down to buy their home in March.

In 2014, about one-fifth of borrowers sold stocks or bonds or borrowed against their retirement accounts to finance a home purchase, according to the National Association of Realtors. (News Corp, which owns The Wall Street Journal, also owns Realtor.com, the listing website of the National Association of Realtors.)

There are no hard and fast rules regarding if and when to cash in stocks to make a home purchase. Lenders and financial planners, however, advise borrowers not to panic, just plan ahead, especially in periods of market volatility. They will caution against borrowing from a retirement plan, because homeowners risk hefty penalties and an income-tax bill if they fail to follow loan-repayment terms.

An alternative to selling stocks is getting a loan secured against assets, saysStephen Stabile, a financial adviser with Merrill Lynch Wealth Management. For example, Bank of America Merrill Lynch has a "loan-management account" that offers clients a line of credit based on their Merrill Lynch taxable brokerage portfolio holdings.

The funds can go toward numerous uses, including a mortgage down payment. Customers with substantial holdings currently may get interest rates that are lower than on 30-year, fixed-rate jumbo mortgages, but could be higher than on other types of mortgages, Mr. Stabile says. One recent borrower, a client who was buying a nearly $5 million New York condo, opted to borrow against her stock holdings instead of selling stocks in a down market.

Borrowers should keep in mind, however, that most banks require a greater collateral amount, usually 125%, for a securities-backed loan than for straight dollars in a bank account, to allow for market fluctuations, says Mike McPartland, head of investment finance for Citibank Private Bank North America. "So if it's a $250,000 down payment, the bank would require that $312,500 remain in that investment account the entire time," he adds.

However, should the stock market fall precipitously, borrowers could be subject to a margin call and forced to pay the difference between the required collateral amount and its current market value, Mr. McPartland says.

Here are a few more factors to consider:

Don't wait too long. Home buyers who wait until the last minute to cash in stocks -- hoping that values will rise -- risk delaying the home closing, since the sale and money transfer can take several business days, says Peter Grabel, managing director of Stamford, Conn.-based Luxury Mortgage Corp. Also, a stock-market drop amid a home purchase could affect a borrower's ability to qualify for a loan, he adds.

Liquidate early. Cash in a bank account is worth more than stocks or mutual funds when it comes to qualifying for a mortgage, because lenders typically value a portfolio at only 70% of its current monetary value, Mr. Grabel says.

Long-term gains. Borrowers whose stock has appreciated significantly will likely face capital-gains taxes when they sell their holdings, adding to the cost of the home, Mr. Stabile says.