Skip to content

Learn

Stock Strategy Development

A US stock free-cash-flow value strategy using available filings

A free-cash-flow value strategy needs a dated financial definition before it needs a ranking. Assemble four nonoverlapping quarters of operating cash flow and capital spending, normalize outflow signs, divide positive free cash flow by contemporaneous equity market value, and select the twenty highest eligible US stocks on fixed quarterly dates. Then rebuild the actual holding and cost ledger.

This guide uses synthetic nonfinancial companies, frozen disclosure snapshots and USD trades. CoTrading fundamental-strategy capabilities remain planned or unverified. The example does not download historical SEC facts or establish that selected stocks are undervalued; it verifies a complete declared mechanism and its cash consequences.

Freeze the cash-flow definition and units

Define free cash flow here as trailing operating cash flow minus positive capital-expenditure outflows. The SEC non-GAAP interpretations explain that free cash flow lacks a uniform definition and needs a clear calculation and reconciliation. This exercise fixes one definition rather than treats every issuer’s similarly named subtotal as interchangeable.

Keep raw statement label, taxonomy mapping, unit, period and sign convention. Operating cash flow is signed; do not take its absolute value. Capital payments may arrive as a positive payment amount or a negative signed outflow. Normalize them according to known source metadata, not by guessing from whichever treatment creates a positive score.

The fixture’s financial amounts and market values use matching normalized units, equivalent to millions of USD; execution prices and account cash are ordinary USD. The financial ratio cancels the shared scale. Do not divide a million-unit cash flow by an unscaled dollar capitalization and then call the result a yield.

Build TTM without overlapping cumulative facts

Require exactly four consecutive quarterly labels and four values for each flow. Do not add an annual total to quarters already inside it, or sum nine-month cumulative cash flow with its component quarters. A provider may require differencing year-to-date facts before these disjoint quarter observations exist.

The SEC EDGAR API reference describes filing context and XBRL facts, but an API response is not automatically an availability-aware TTM panel. Preserve accession, context, reporting interval and usable time for each underlying fact. The supplied snapshots represent that upstream work as frozen inputs rather than pretend it was performed by the toy script.

At each quarterly cutoff, filter by availability first and choose the latest permitted reporting period and version. March 31 can use the supplied February 15 snapshot ending December 31; June 30 can use the May 15 snapshot ending March 31. It must not use a later quarter simply because that fact is visible in today’s downloaded archive.

Set eligibility before ranking

Exclude financial companies under this research policy, unavailable required facts, invalid capitalization and nonpositive free cash flow. The exclusion is not a judgment that every financial stock is unattractive; the operating and capital-spending interpretation is restricted to the declared nonfinancial universe.

Use the capitalization snapshot attached to the same decision date, including its currency and share-class scope. A single current capitalization backfilled across all quarters defeats the temporal design. The synthetic denominator is fixed at 1,000 for every company solely to isolate the cash-flow and availability mechanism.

Rank positive yields descending, with a stable identifier breaking ties, and take twenty slots. If fewer qualify, an implementation must state its cash or sizing policy rather than silently include negative values. This fixture has twenty eligible names at each shown decision and gives each forty shares at the supplied entry open.

Reconstruct the first quarterly list

S01 through S20 have operating cash flow 40 plus the stock number and normalized capital spending twenty. S20 therefore has operating cash flow sixty, free cash flow forty and yield four percent. S01 has free cash flow twenty-one and yield 2.1%. The selected list runs S20 down through S01.

S21’s first snapshot has operating cash flow ten and capital spending twenty, giving negative free cash flow and no eligibility. S22 is financial and excluded before ranking. Keep those reasons beside the score panel; a missing selected flag does not explain whether the stock lost on value or failed an earlier gate.

The June snapshot adds a genuine new quarter for S21: its rolling operating flows become two, three, three and ninety-two, totaling one hundred. Free cash flow becomes eighty and yield eight percent. It enters first, followed by S20 through S02; S01 leaves. This update is usable only after its supplied May availability.

Follow the quarterly trades into cash

Start with 10,000. The first supplied execution date is April 1, after the March cutoff. Buy twenty names, forty shares each at ten, with a fictional fee of one per order. Stock notional is 8,000, fees twenty and remaining cash 1,980. Immediate open-price equity is 9,980, equal to initial capital less those fees.

The second supplied open is July 1, after the June cutoff. Sell forty S01 at eleven, net 439, then buy forty S21 at ten for 401 including its fee. Cash becomes 2,018, cumulative fees twenty-two and there are twenty holdings. The other nineteen names are retained without invented replacement orders.

At the declared July 2 terminal open, sell all twenty positions at 10.2 and pay twenty more fees. Proceeds after fees are 8,140, producing final cash 10,158 and no shares. Gross modeled price gain is two hundred, total fees forty-two and net gain 158. These are synthetic values, not historical value-factor returns.

Test sign and period failures separately

Convert the negative-outflow capital-spending inputs into positive payment inputs while changing their declared convention. The normalized score must remain identical. Leaving positive inputs under a negative-outflow convention instead produces negative normalized spending and raises an error; the script does not hide it with an unconditional absolute value.

A second counterexample repeats the same quarterly label four times. That is not TTM, even if the numeric sum looks plausible, so it is rejected. The sign error and period-overlap error are different mechanisms and need different evidence. A favorable account result cannot authorize either input shortcut.

Run the cash-flow strategy pack

Download the complete example, save it as R588.py and run python R588.py with Python 3.12 or later. The standard-library source is docs/growth/research/round-5/examples/R588.py; no live financial data or account is accessed.

Assertions require both exact twenty-name lists, S20’s four-percent yield, first-period availability lineage, input-order invariance, sign equivalence and invalid-period rejection. Every initial, replacement and terminal order is checked alongside cash, fees and final zero holdings. A correct ending balance alone is not accepted as proof that the correct stocks traded.

Maintain the research version without changing its claim

Archive raw financial contexts, disjoint-quarter construction, sign mapping, usable timestamps, market-value snapshots, historical universe, schedule, quantities and costs. Reconstruct one exclusion and one replacement from those artifacts before extending a historical study.

When a filing is amended or a market-value input changes, rerun the affected decisions using the version available at each cutoff. Keep the original run and the source of the first difference. Completion means the stated positive-cash-flow ranking and modeled trades are reproducible. It does not establish intrinsic value, remove financing obligations or provide evidence that a free-cash-flow label guarantees investment returns.

Preserve a decision-level reconciliation

For each rebalance, export the allowed snapshot identifier, four quarter labels, normalized capex, free cash flow, denominator and final rank before generating any orders. The first replacement should explain why S01 leaves despite retaining positive free cash flow: twenty higher-ranked eligible names now exist. It is a ranking exit rather than a failed-sign rejection. Keep that distinction when later comparing turnover or diagnosing a provider update, because a changed membership reason can require a different correction even when the same sale appears.

FAQ

Can I use an issuer’s named free-cash-flow number without mapping it?

Not safely. Definitions and reconciliation need to match the declared strategy input.

Does a negative capital-spending field mean spending should be added?

Normalize its known outflow convention first; do not guess or use an unconditional absolute value.