Managing the risks of foreign trade and investment