Don’t worry about buying at the top
Many people have a fear of buying at the top, but the fear may be unjustified.

A study performed by Vanguard, American Funds and other companies show that even if you were misfortunate to invest once a year at the market’s annual high, you still would have actually achieved decent returns over time.

The numbers
If you have invested $1000 every year in three different ways (SP 500) for 25 years:

The year low: average yearly return: 13.41% - final value: $178 353
The year high: average yearly return 11.86% - final value: $138 604
On Dec 31: average yearly return 12.43% - final value: $160 113

So it is not that bad to buy on top.