Is borrowing to invest a bad idea?

How it can amplify your gains but also your losses