Major equity markets closed with modest gains this week despite mounting headwinds.