The investor is neither smart not richer when he buys in an advancing market and the market continues to rise. That is true even when he cashes in a goodly profit, unless either (a) he is definitely through with buying stocks—an unlikely story—or (b) he is determined to reinvest only at considerably lower levels. In a continuous program no market profit is fully realized until the later reinvestment has actually taken place, and the true measure of the trading profit is the difference between the previous selling level and the new buying level.
Chapter II, The Investor and Stock-Market Fluctuations, p. 24 - The Intelligent Investor: The Classic Text on Value Investing (1949)