Trade, Financial Flows and Foreign Investment