Stock markets end week on high note, after weeks of declines