“Buy on the cannons and sell on the trumpets”:

“Buy on the Cannons and Sell on the Trumpets” — Meaning

This time-tested investing maxim is that investors ought to buy stocks when there is crisis, panic, or war (“the sound of cannons”) and fear is rampant and prices are cheapened, and sell when there is celebration or good tidings (“the sound of trumpets”) and confidence is high and prices have rebounded.

The reasoning is that peak pessimism commonly signals bottoms of the market, which are opportunities for long-term profit, whereas euphoria typically signals market peaks and potential for correction. Peter Lynch and other great investors have used this principle to emphasize contrarian philosophy—doing the opposite of the crowd at extremes of greed and fear.