Skip to content

Commit

Permalink
Use TTM EPS (mrhappyasthma#97).
Browse files Browse the repository at this point in the history
  • Loading branch information
kocielnik committed Feb 17, 2025
1 parent 715d9e0 commit 930058c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions isthisstockgood/Active/MSNMoney.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def parse_ratios_data(self, content):

# Debt
self._parse_debt_to_equity(quarterly_data)

# Quarterly EPS for MOSP valuation
self.quarterly_eps = _extract_data_for_key(quarterly_data, "earningsPerShare")

return True

Expand Down
9 changes: 7 additions & 2 deletions isthisstockgood/DataFetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ def fetchDataForTickerSymbol(ticker):
else zacks_analysis.five_year_growth_rate if zacks_analysis \
else 0
# TODO: Use TTM EPS instead of most recent year
margin_of_safety_price, sticker_price = \
_calculateMarginOfSafetyPrice(msn_money.equity_growth_rates[-1], msn_money.pe_low, msn_money.pe_high, msn_money.eps[-1], five_year_growth_rate)
margin_of_safety_price, sticker_price = _calculateMarginOfSafetyPrice(
msn_money.equity_growth_rates[-1],
msn_money.pe_low,
msn_money.pe_high,
msn_money.quarterly_eps[-1],
five_year_growth_rate
)
payback_time = _calculatePaybackTime(msn_money.equity_growth_rates[-1], msn_money.last_year_net_income, msn_money.market_cap, five_year_growth_rate)
free_cash_flow_per_share = float(msn_money.free_cash_flow[-1])
computed_free_cash_flow = round(free_cash_flow_per_share * msn_money.shares_outstanding)
Expand Down

0 comments on commit 930058c

Please sign in to comment.