The ratio between current earnings per share and the share price (the EP ratio) is widely used to judge how expensive the stock of a corporation is, relative to its ability to earn profits. Using euro area aggregate stock market data, I show that judgements based on the EP ratio may be myopic because movements in the EP ratio are often driven by cyclical oscillations in earnings that do not affect the long-run profitability of corporations. I propose an adjustment to the EP ratio that decreases its sensitivity to cyclical fluctuations and I find periods in which such an adjustment is very consequential. For example, before the 2008 financial crisis the unadjusted EP ratio made stock prices look relatively cheap; the adjustment I propose would have taken into account the fact that earnings were inflated by a temporary cyclical boost and would have made them look much less cheap. The model I propose translates the EP ratio into an estimate of the probability that the stock market is under- or over-valued. Simulating its real-time use, I find that the model would have been able to provide early warning signals of some episodes of mis-valuation that were eventually followed by sharp corrections in stock prices.