San Francisco Frontiers - Stock markets mostly gain at end of turbulent week