From an article published at ofdollarsanddata.com:
What about buying near record highs? The S&P 500 has periods of what I call "fits and starts", or lacklustre growth and then explosive growth … let’s consider the real monthly returns (including dividends) of the S&P500 from 1880 to 2016.
Of the 1,644 monthly returns in the data, 356 were record highs, which represents about 22% of all months.