Investor confidence soared after the 2016 election of Donald J. Trump, sending the U.S. stock market on a tear that would last a full year. It also made housing more expensive. That is because when the stock market rallies, the bond market usually sells off, and bond yields rise. Mortgage rates loosely follow the yield on the 10-year Treasury. The average rate on the popular 30-year fixed mortgage hovered around 3.5 percent in the fall of 2016 and then shot up to as high as 4.3 percent immediately after the election, according to Freddie Mac. It stayed above 4 percent for the first half of the year and is currently just below that now.