The crash could still happen one day after you put the last dollar in. If you can’t handle such a crash, you need to invest less in stock all the time, not just for a few weeks/months after receiving a windfall.
Of course you are measuring that against the fact that the market generally goes up, so any dollars held outside the market are missing gains over time.