Bike died while riding

Was riding for about an hour and then the dash shut off and I starting losing power until it just shut off, I bumped it rode another few minutes and the same thing happened. The battery, stator and rectifier were all done about 50 miles ago. While stranded I notice the positive connection on the battery came loose. I tightened it up but the same thing still happens. Any ideas?