A Theory of Managed Trade