Skip to main content

Crate value_metrics

Crate value_metrics 

Source
Expand description

§value-metrics

Core equity valuation ratios used to screen for deep-value stocks: price-to-earnings, price-to-book, earnings yield, EV/EBIT, and dividend yield. Pure Rust, no deps. Same signals behind the DeepValueRadar value screener.

use value_metrics::*;
assert!((price_to_earnings(100.0, 5.0) - 20.0).abs() < 1e-9);
assert!((earnings_yield(5.0, 100.0) - 0.05).abs() < 1e-9);

Functions§

dividend_yield
Dividend yield = annual dividend per share / price.
earnings_yield
Earnings yield = EPS / price (the reciprocal of P/E).
ev_to_ebit
EV/EBIT = enterprise value / EBIT.
price_to_book
Price-to-book ratio = price / book value per share.
price_to_earnings
Price-to-earnings ratio = price / earnings per share.