How Global Capital Flows Influence Stock Market Trends