Documentation
¶
Overview ¶
Package valuemetrics implements the core equity value metrics used in fundamental stock analysis: price-to-earnings (P/E), price-to-book (P/B), and earnings yield. These are the same formulas behind the DeepValueRadar value-investing tools at https://deepvalueradar.com/.
A multiple on its own is not a verdict. These numbers are screen inputs, and the rules that consume them there - how the universe is constructed, the valuation-gap trigger a candidate has to clear, and how conviction is scored afterwards - are written up at https://deepvalueradar.com/methodology/.
Quick example:
pe := valuemetrics.PriceToEarnings(50.0, 2.0) // share price / EPS // pe == 25.0 y := valuemetrics.EarningsYield(25.0) // 1 / P/E // y ~= 0.04 (4%) _ = valuemetrics.PriceToBook(50.0, 30.0, 1.0) // price / book per share
Index ¶
- func BookValuePerShare(commonEquity, sharesOutstanding float64) float64
- func EarningsPerShare(netIncome, sharesOutstanding float64) float64
- func EarningsYield(eps, pricePerShare float64) float64
- func EarningsYieldFromPE(pe float64) float64
- func PEVerdict(pe float64) string
- func PriceToBook(pricePerShare, bookValuePerShare float64) float64
- func PriceToEarnings(pricePerShare, eps float64) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BookValuePerShare ¶
BookValuePerShare returns common equity divided by shares outstanding. It returns 0.0 if shares outstanding is non-positive.
func EarningsPerShare ¶
EarningsPerShare returns net income divided by shares outstanding (basic EPS). It returns 0.0 if shares outstanding is non-positive.
func EarningsYield ¶
EarningsYield returns EPS divided by price per share — the reciprocal of the P/E ratio. It returns 0.0 if price is non-positive. Useful for comparing a stock's earnings power directly to bond yields.
func EarningsYieldFromPE ¶
EarningsYieldFromPE returns the earnings yield for a given P/E ratio. It returns 0.0 if the P/E ratio is non-positive.
func PEVerdict ¶
PEVerdict returns a plain-language read on a P/E multiple vs. a broad-market benchmark (defaulted to ~20x for the modern S&P 500 average).
func PriceToBook ¶
PriceToBook returns the P/B ratio: market price per share divided by book value per share. It returns 0.0 if book value per share is non-positive.
func PriceToEarnings ¶
PriceToEarnings returns the trailing P/E ratio: price per share divided by earnings per share (EPS). It returns 0.0 if EPS is non-positive (P/E is undefined or negative earnings => not a meaningful positive multiple).
Types ¶
This section is empty.