Investors widely expect the Federal Reserve to cut interest rates this month, triggering a swing in overall market sentiment and leading to gains.