2. Step-by-Step Math & Formulas
2.1 Graham Value & Margin of Safety (MOS)
Imagine walking into a supermarket and seeing an item genuinely worth $100 on sale for $60. That $40 gap is your safety buffer if something goes wrong. In the stock market, Graham calculated this fair value by checking how much profit a company earns ($EPS$) alongside its net physical assets ($BVPS$).
The classic Graham Intrinsic Value formula uses $22.5$ as a benchmark multiplier (based on Graham's rule of thumb that a fair company should not exceed $15 \times$ earnings and $1.5 \times$ book value):
\[ V_{Graham} = \sqrt{22.5 \times EPS \times BVPS} \]
Where:
- $EPS$ = Earnings Per Share (TTM, profit earned per share over the last 12 months).
- $BVPS$ = Book Value Per Share ($\frac{\text{Total Equity}}{\text{Outstanding Shares}}$, net assets per share).
Once we have Graham's estimated fair value ($V_{Graham}$), we compare it to today's market price ($P$) to measure the discount, known as the Margin of Safety ($MOS$):
\[ MOS = \frac{V_{Graham} - P}{V_{Graham}} \]
A higher $MOS$ means you are buying the business at a bigger discount to its fundamental backing.
2.2 Peter Lynch's PEG Ratio (Valuation vs. Growth)
A Price-to-Earnings ($P/E$) of 20 might look expensive on paper. But what if the business is growing its profits by 30% a year? That is actually a bargain! Conversely, a P/E of 10 for a company growing at only 2% is secretly overpriced. Peter Lynch created the PEG ratio to check if the growth speed justifies the price tag:
\[ PEG = \frac{P / E}{g_{EPS} \times 100} \]
Where $g_{EPS}$ is the year-over-year earnings growth rate (for example, $0.20$ for $20\%$ annual growth).
Rule of thumb: A PEG around $1.0$ is considered fairly priced. A PEG well below $1.0$ indicates you are getting high growth at an attractive price. For ranking, lower is better, so the algorithm prioritizes companies with a lower PEG ratio.
2.3 Why Percentile Ranking? (Grading on a Curve)
Suppose one company has a normal Margin of Safety of $30\%$, while another company experienced a one-time abnormal accounting event that temporarily made its raw score $5,000\%$. If we simply averaged raw numbers, that one outlier stock would distort and break the whole scale for everyone else!
To solve this fairly, we do what university professors do: we grade on a curve. Instead of using raw numbers, every eligible stock is ranked from worst to best against its peers across the entire exchange. The top company gets a score near $100$, the average company gets around $50$, and the bottom gets near $0$. If two companies tie, they cleanly share the average rank:
\[ PR(x_i) = \frac{\text{Rank}_{avg}(x_i) - 0.5}{N} \times 100 \]
Where:
- $N$ = Total number of eligible stocks screened on the exchange.
- $\text{Rank}_{avg}(x_i)$ = The position of stock $x_i$ when ordered from lowest to highest. If two stocks have identical values, both receive the average rank of the tied group.
- $PR(x_i)$ = The resulting percentile score, always cleanly bound between $0$ and $100$.
2.4 Final GL Composite Score (The Recipe)
How much weight do we give to safety (Graham) versus growth (Lynch)? We give a slightly higher weight of 55% to Graham to prioritize capital preservation first, and 45% to Lynch to capture growth acceleration:
\[ GLScore_{raw} = 0.55 \times PR_{Graham} + 0.45 \times PR_{Lynch} \]
A normalization vector $V_{ABC} = [83.35, 86.55, 84.79]$ is used as an econometric baseline to maintain cross-cohort consistency across varying market cycles:
\[ GLScore = \min\left(100, \, GLScore_{raw} \times \frac{\|V_{ABC}\|_2}{\bar{V}_{ABC}}\right) \]
The final score ranges from 0 to 100, making it easy to spot top candidates at a glance: 90+ Exceptional, 80+ Strong, 70+ Attractive, 60+ Neutral, and <60 Weak.
Gem Hunter, Gem Guard, and Gem Sentinel are quantitative screening research tools and not financial advice, a recommendation to buy or sell securities, or a guarantee of future performance. Always conduct your own comprehensive analysis.