The stock market just hit a record high and history suggests it’s headed even higher