Point-in-time fundamentals for strategies: statement values as they were known on the backtest date, and valuation and quality ratios built on them.
A value is visible from the day its report became public (see
clojure-backtesting.yahoo.build/report-date), never earlier. Values come
back in the share basis of the backtest date, so per-share figures and
share counts match the day's quoted price even when a later split has
been applied to the source data, and in the security's trading currency
(major unit: pounds, not pence), converted at the previous day's FX rate
when the company reports in another currency. A value that cannot be stated that
way (no FX rate, nothing public yet, or a period that ended more than
FUNDAMENTALS-MAX-AGE-MONTHS ago) is nil, never guessed.
Fields are kebab-case Yahoo statement fields such as :total-revenue, :net-income, :diluted-eps, :stockholders-equity or :ordinary-shares-number. Frequencies: :quarterly the latest quarter :annual the latest fiscal year :trailing Yahoo's own trailing-twelve-month figure :ttm twelve months: Yahoo's trailing figure, the sum of the last four quarters, or the last fiscal year, whichever ends latest (flow fields only; share counts and rates take the latest quarter instead of a sum) :latest the latest quarter or fiscal year, whichever ends latest With no frequency, income-statement and cash-flow fields use :ttm and balance-sheet fields :latest.
Point-in-time fundamentals for strategies: statement values as they were
known on the backtest date, and valuation and quality ratios built on
them.
A value is visible from the day its report became public (see
`clojure-backtesting.yahoo.build/report-date`), never earlier. Values come
back in the share basis of the backtest date, so per-share figures and
share counts match the day's quoted price even when a later split has
been applied to the source data, and in the security's trading currency
(major unit: pounds, not pence), converted at the previous day's FX rate
when the company reports in another currency. A value that cannot be stated that
way (no FX rate, nothing public yet, or a period that ended more than
FUNDAMENTALS-MAX-AGE-MONTHS ago) is nil, never guessed.
Fields are kebab-case Yahoo statement fields such as :total-revenue,
:net-income, :diluted-eps, :stockholders-equity or
:ordinary-shares-number. Frequencies:
:quarterly the latest quarter
:annual the latest fiscal year
:trailing Yahoo's own trailing-twelve-month figure
:ttm twelve months: Yahoo's trailing figure, the sum of the last
four quarters, or the last fiscal year, whichever ends
latest (flow fields only; share counts and rates take the
latest quarter instead of a sum)
:latest the latest quarter or fiscal year, whichever ends latest
With no frequency, income-statement and cash-flow fields use :ttm and
balance-sheet fields :latest.(available-fields permno)The fundamental fields known for permno, sorted.
The fundamental fields known for `permno`, sorted.
(book-to-market permno)Book equity over market capitalisation.
Book equity over market capitalisation.
(clear-fundamentals!)Unloads the fundamentals.
Unloads the fundamentals.
(current-ratio permno)Current assets over current liabilities.
Current assets over current liabilities.
(days-since-earnings permno)Calendar days since the latest public earnings announcement, or nil.
Calendar days since the latest public earnings announcement, or nil.
(debt-to-equity permno)Total debt over book equity; nil when equity is not positive.
Total debt over book equity; nil when equity is not positive.
(dividend-yield permno)Dividends with an ex-date in the last 365 days over today's price, both per share of today's basis. Uses the price history's dividends, so it needs no statement data.
Dividends with an ex-date in the last 365 days over today's price, both per share of today's basis. Uses the price history's dividends, so it needs no statement data.
(earnings-yield permno)Twelve-month diluted EPS over price (negative for losses).
Twelve-month diluted EPS over price (negative for losses).
(enterprise-value permno)Market capitalisation plus total debt minus cash; nil unless all three are known.
Market capitalisation plus total debt minus cash; nil unless all three are known.
(ev-to-ebitda permno)Enterprise value over twelve-month EBITDA; nil when EBITDA is not positive.
Enterprise value over twelve-month EBITDA; nil when EBITDA is not positive.
(free-cash-flow-yield permno)Twelve-month free cash flow over market capitalisation.
Twelve-month free cash flow over market capitalisation.
(fundamental permno field)(fundamental permno field frequency)The latest public value of field for permno on the backtest date,
or nil. See the namespace docstring for frequency.
The latest public value of `field` for `permno` on the backtest date, or nil. See the namespace docstring for `frequency`.
(fundamental-as-of date permno field)(fundamental-as-of date permno field frequency)Like fundamental, on date rather than the backtest date.
Like fundamental, on `date` rather than the backtest date.
(fundamental-history permno field frequency n)Up to n public values of field at frequency (:quarterly, :annual or
:trailing) on the backtest date, newest first, each as fundamental-info
describes it. Old values are included regardless of their age.
Up to `n` public values of `field` at `frequency` (:quarterly, :annual or :trailing) on the backtest date, newest first, each as fundamental-info describes it. Old values are included regardless of their age.
(fundamental-info permno field)(fundamental-info permno field frequency)The latest public value of field for permno on the backtest date,
with where it comes from: {:value :field :frequency :source :period-end
:report-date :public-date :report-date-source :reported-value
:reported-currency :currency}. :report-date-source says how the public
date was found (:earnings-history, :announcement, or :lag when it is an
assumed reporting lag). nil when nothing is public yet or it is too old.
The latest public value of `field` for `permno` on the backtest date,
with where it comes from: {:value :field :frequency :source :period-end
:report-date :public-date :report-date-source :reported-value
:reported-currency :currency}. :report-date-source says how the public
date was found (:earnings-history, :announcement, or :lag when it is an
assumed reporting lag). nil when nothing is public yet or it is too old.(fundamental-info-as-of date permno field frequency)Like fundamental-info, on date rather than the backtest date.
Like fundamental-info, on `date` rather than the backtest date.
{security-id entry}, as written by clojure-backtesting.yahoo.build.
{security-id entry}, as written by clojure-backtesting.yahoo.build.
(fx-rate from to date)Units of to per unit of from known on date: the latest rate dated
before it, since a day's FX close comes after many markets close. 1.0
when the currencies are the same, nil when unknown.
Units of `to` per unit of `from` known on `date`: the latest rate dated before it, since a day's FX close comes after many markets close. 1.0 when the currencies are the same, nil when unknown.
{[from to] (sorted-map date rate)}: units of to per unit of from.
{[from to] (sorted-map date rate)}: units of `to` per unit of `from`.
(gross-margin permno)Twelve-month gross profit over revenue.
Twelve-month gross profit over revenue.
(growth permno field)(growth permno field frequency)Year-on-year growth of field at frequency (:annual by default, or
:quarterly for the latest quarter against the same quarter a year
before): latest / year-earlier - 1, nil when the year-earlier value is
missing or not positive.
Year-on-year growth of `field` at `frequency` (:annual by default, or :quarterly for the latest quarter against the same quarter a year before): latest / year-earlier - 1, nil when the year-earlier value is missing or not positive.
(latest-earnings permno)The latest earnings announcement public on the backtest date: {:report-date :public-date :period-end :eps-actual :eps-estimate :surprise-pct}, or nil. :surprise-pct is in percent.
The latest earnings announcement public on the backtest date:
{:report-date :public-date :period-end :eps-actual :eps-estimate
:surprise-pct}, or nil. :surprise-pct is in percent.(load-fundamentals path)Loads a fundamentals.edn file (as build-yahoo-dataset! writes it), replacing any fundamentals loaded before.
Loads a fundamentals.edn file (as build-yahoo-dataset! writes it), replacing any fundamentals loaded before.
(market-cap permno)Today's price times shares outstanding, in the trading currency.
Today's price times shares outstanding, in the trading currency.
(net-margin permno)Twelve-month net income over revenue.
Twelve-month net income over revenue.
(operating-margin permno)Twelve-month operating income over revenue.
Twelve-month operating income over revenue.
(pe-ratio permno)Price over twelve-month diluted EPS; nil when EPS is not positive.
Price over twelve-month diluted EPS; nil when EPS is not positive.
(piotroski-f-score permno)The F-score (0 to 9): the number of piotroski-signals that hold. nil unless all nine can be computed, which needs three fiscal years of total assets.
The F-score (0 to 9): the number of piotroski-signals that hold. nil unless all nine can be computed, which needs three fiscal years of total assets.
(piotroski-signals permno)The nine signals of Piotroski's (2000) F-score from the last two fiscal years, each true, false, or nil when its inputs are missing: :roa (net income over beginning assets is positive), :cfo (operating cash flow is positive), :delta-roa (ROA improved), :accrual (cash flow exceeds net income), :delta-leverage (long-term debt over assets fell), :delta-liquidity (current ratio rose), :no-dilution (shares did not increase), :delta-margin (gross margin rose), :delta-turnover (revenue over beginning assets rose). Years are aligned on the fiscal years of total assets.
The nine signals of Piotroski's (2000) F-score from the last two fiscal years, each true, false, or nil when its inputs are missing: :roa (net income over beginning assets is positive), :cfo (operating cash flow is positive), :delta-roa (ROA improved), :accrual (cash flow exceeds net income), :delta-leverage (long-term debt over assets fell), :delta-liquidity (current ratio rose), :no-dilution (shares did not increase), :delta-margin (gross margin rose), :delta-turnover (revenue over beginning assets rose). Years are aligned on the fiscal years of total assets.
(price-to-book permno)Market capitalisation over book equity; nil when equity is not positive.
Market capitalisation over book equity; nil when equity is not positive.
(return-on-assets permno)Twelve-month net income over total assets.
Twelve-month net income over total assets.
(return-on-equity permno)Twelve-month net income over book equity; nil when equity is not positive.
Twelve-month net income over book equity; nil when equity is not positive.
(sales-to-price permno)Twelve-month revenue over market capitalisation.
Twelve-month revenue over market capitalisation.
(shares-outstanding permno)Shares outstanding in today's share basis: the latest ordinary shares number, else shares issued, else diluted average shares. nil, with a warning, when it differs more than twofold from the count implied by net income over diluted EPS: Yahoo counts some multi-class companies in another class than the one quoted (Berkshire Hathaway's B shares in A equivalents), which would make every ratio on market value wrong.
Shares outstanding in today's share basis: the latest ordinary shares number, else shares issued, else diluted average shares. nil, with a warning, when it differs more than twofold from the count implied by net income over diluted EPS: Yahoo counts some multi-class companies in another class than the one quoted (Berkshire Hathaway's B shares in A equivalents), which would make every ratio on market value wrong.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |