Effective risk control must make a tradeoff between the microprudential risk of exogenous shocks to individual institutions and the macroprudential risks caused by their systemic interactions. We investigate a simple dynamical model for understanding this tradeoff, consisting of a bank with a leverage target and an unleveraged fundamental investor subject to exogenous noise with clustered volatility. The parameter space has three regions: (i) a stable region, where the system always reaches a fixed point equilibrium; (ii) a locally unstable region, characterized by cycles and chaotic behavior; and (iii) a globally unstable region. A crude calibration of parameters to data puts the model in region (ii). In this region there is a slowly building price bubble, resembling a “Great Moderation”, followed by a crash, with a period of approximately 10-15 years, which we dub the Basel leverage cycle. We propose a criterion for rating macroprudential policies based on their ability to minimize risk for a given average leverage. We construct a one parameter family of leverage policies that allows us to vary from the procyclical policies of Basel II or III, in which leverage decreases when volatility increases, to countercyclical policies in which leverage increases when volatility increases. We find the best policy depends critically on three parameters: The average leverage used by the bank; the relative size of the bank and the fundamentalist, and the amplitude of the exogenous noise. Basel II is optimal when the exogenous noise is high, the bank is small and leverage is low; in the opposite limit where the bank is large or leverage is high the optimal policy is closer to constant leverage. We also find that systemic risk can be dramatically decreased by lowering the leverage target adjustment speed of the banks.