The monthly trade deficit continued to shrink in October after President Trump imposed sweeping tariffs on foreign imports.