Given a stock, is there any mathematical equation than can determine if that stock is oversold?
I will use the equation against all stocks in the market to generate a sorted list of oversold stocks.
There are those who would suggest that due to the Efficient Market Hypothesis, stocks are always fairly valued. Consider, if non-professional posters on SE (here) had a method that worked beyond random chance, everyone seeking such a method would soon know it. If everyone used that method, it would lose its advantage. In theory, this is how stocks' values remain rational.
That said, Williams %R is one such indicator. It can be seen in action on Yahoo finance -
In the end, I find such indicators far less useful than the news itself. BP oil spill - Did anyone believe that such a huge oil company wouldn't recover from that disaster? It recovered by nearly doubling from its bottom after that news. A chart of NFLX (Netflix) offers a similar news disaster, and recovery.
Both of these examples are not quantifiable, in my opinion, just gut reactions. A quick look at the company and answer to one question - Do I feel this company will recover? To be candid - in the 08/09 crash, I felt that way about Ford and GM. Ford returned 10X from the bottom, GM went through bankruptcy. That observation suggests another question, i.e. where is the line drawn between 'investing' and 'gambling'? My answer is that buying one stock hoping for its recovery is gambling. Being able to do this for 5-10 stocks, or one every few months, is investing.
To my knowledge, there's no universal equation, so this could vary by individual/company. The equation I use (outside of sentiment measurement) is the below - which carries its own risks:
This equations assumes two key points:
Anything over 1.2 is considered oversold if those two conditions apply. The reason for the bear market is that that's the time stocks generally go on "sale" and if a company has a solid balance sheet, even in a downturn, while their profit may decrease some, a value over 1.2 could indicate the company is oversold.
An example of this is Warren Buffett's investment in Wells Fargo in 2009 (around March) when
As an interesting side note on this,
Still, this equation is not without its risks. A company may have a solid balance sheet, but end up borrowing more money while losing a ton of profit, which the investor finds out about ad-hoc (seen this happen several times). Suddenly, what "appeared" to be a good sale, turns into a person buying a penny with a dollar. This is why, to my knowledge, no universal equation applies, as if one did exist, every hedge fund, mutual fund, etc would be using it.
One final note: with robotraders becoming more common, I'm not sure we'll see this type of opportunity again. 2009 offered some great deals, but a robotrader could easily be built with the above equation (or a similar one), meaning that as soon as we had that type of environment, all stocks fitting that scenario would be bought, pushing up their PEs. Some companies might be willing to take an "all risk" if they assess that this equation works for more than n% of companies (especially if that n% returns an m% that outweighs the loss). The only advantage that a small investor might have is that these large companies with robotraders are over-leveraged in bad investments and with a decline, they can't make the good investments until its too late. Remember, the equation ultimately assumes a person/company has free cash to use it (this was also a problem for many large investment firms in 2009 - they were over-leveraged in bad debt).
What you are seeking is termed "Alpha", the mispricing in the market. Specifically, Alpha is the price error when compared to the market return and beta of the stock.
Modern portfolio theory suggests that a portfolio with good Alpha will maximize profits for a given risk tolerance.
The efficient market hypotheses suggests that Alpha is always zero. The EMH also suggests that taxes, human effort and information propagation delays don't exist (i.e. it is wrong).
For someone who is right, the best specific answer to your question is presented Ben Graham's book "The Intelligent Investor" (starting on page 280). And even still, that book is better summarized by Warren Buffet (see Berkshire Hathaway Letters to Shareholders).
In a great disservice to the geniuses above it can be summarized much further: closely follow the company to estimate its true earnings potential... and ignore the prices the market is quoting.
ADDENDUM: And when you have earnings potential, calculate value with: NPV = sum(each income piece/(1+cost of capital)^time)
Update: See http://finance.fortune.cnn.com/2014/02/24/warren-buffett-berkshire-letter/ "When Charlie Munger and I buy stocks..." for these same ideas right from the horse's mouth