An almost nine percent slump in Shanghai last Tuesday triggered a wave of selling on global markets , many of which had been trading near record highs .