Ragman has the answer. You need to keep enough cash around. I ran into this same problem when I inadvertently ran afoul of the rules by selling a stock that I bought earlier that day, then using the proceeds, including the profit, to buy another stock.
In my case, the account went on "restriction", and I could then only trade with "settled" funds. As I understand the rules, on a given day you can trade with funds (settled and unsettled) at the start of the day, plus sales made during the day.
I strongly suggest you discuss the application of this rule with your broker so you don't run afoul of it, especially if you intend to trade in an IRA. I did find out at my broker the "flag" for them is the sale of the same (shares of a) stock on the same day, but if you hold them overnight, the account is not flagged. In other words, you can trade with unsettled funds (g), not that I'm recommending that.
I'm speaking from experience only. I'm no expert here, but the rules apply to all brokers.
Good luck!
AK