The best conditions for buying a stock are when it's unpopular, it's cheap, there's limited downside, it's relatively undiscovered, you understand the company and its business better than other investors do, and company management is incentivized to build shareholder value.