# Piotroski F-Score

`D18-F04-A02` · Fundamental Analysis and Valuation → Quality and Distress · archetype `record-transform` · difficulty 2/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/quality-and-distress/piotroski-f-score/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { piotroskiFScore } from "fintech-algorithms/fundamental-analysis-and-valuation/quality-and-distress/piotroski-f-score";
```

## Signature

```ts
piotroskiFScore(data)
```

Scores the nine binary Piotroski signals covering profitability, leverage and liquidity, and operating efficiency across the current and prior year, and sums them into an F-Score from 0 to 9.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ net_income: number; prior_net_income: number; operating_cash_flow: number; beginning_total_assets: number; prior_beginning_total_assets: number; long_term_debt: number; prior_long_term_debt: number; current_assets: number; current_liabilities: number; prior_current_assets: number; prior_current_liabilities: number; equity_issued: number; gross_profit: number; prior_gross_profit: number; sales: number; prior_sales: number }` | yes | Current and prior-year accounting values in one flat record. The function reads `beginning_total_assets` and `prior_beginning_total_assets` as the ROA and turnover denominators, `net_income`, `prior_net_income` and `operating_cash_flow` for the profitability signals, `long_term_debt`, `prior_long_term_debt`, `current_assets`, `current_liabilities`, `prior_current_assets`, `prior_current_liabilities` and `equity_issued` for the leverage and liquidity signals, and `gross_profit`, `prior_gross_profit`, `sales` and `prior_sales` for the efficiency signals. |

## Returns

`{ state: string; method: string; signals: { positive_roa: number; positive_cfo: number; improving_roa: number; cash_exceeds_income: number; lower_leverage: number; higher_current_ratio: number; no_equity_issue: number; higher_gross_margin: number; higher_asset_turnover: number }; f_score: number; band: string; signal_count: number }`

`signals` carries each of the nine tests as 0 or 1 and `f_score` is their sum. `band` is `weak-signals` at 2 or below, `strong-signals` at 8 or above and `mixed-signals` between. `signal_count` is always 9, `method` is `piotroski-2000-nine-signal` and `state` is `calculated`.

## Errors

- When data is not a plain object — throws TypeError
- When any field read is missing or not a finite number — throws TypeError
- When any of beginning_total_assets, prior_beginning_total_assets, current_assets, current_liabilities, prior_current_assets, prior_current_liabilities, sales or prior_sales is zero or negative — throws RangeError
- When equity_issued is negative — throws RangeError

## Complexity

Time `O(1)`, space `O(1)`.

## Worked example

Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

### Input

`data`:

```json
{
  "net_income": 80,
  "prior_net_income": 50,
  "operating_cash_flow": 110,
  "beginning_total_assets": 900,
  "prior_beginning_total_assets": 850,
  "long_term_debt": 260,
  "prior_long_term_debt": 300,
  "current_assets": 500,
  "current_liabilities": 250,
  "prior_current_assets": 430,
  "prior_current_liabilities": 250,
  "equity_issued": 0,
  "gross_profit": 480,
  "prior_gross_profit": 390
}
```

Showing 14 of 16 fields.

### Call

```ts
piotroskiFScore(data)
```

### Returns

object with 6 fields: state, method, signals, f_score, band, signal_count

```json
{
  "state": "calculated",
  "method": "piotroski-2000-nine-signal",
  "signals": {
    "positive_roa": 1,
    "positive_cfo": 1,
    "improving_roa": 1,
    "cash_exceeds_income": 1,
    "lower_leverage": 1,
    "higher_current_ratio": 1,
    "no_equity_issue": 1,
    "higher_gross_margin": 1,
    "higher_asset_turnover": 1
  },
  "f_score": 9,
  "band": "strong-signals",
  "signal_count": 9
}
```

## Other exports

`calculate`, `altmanZScore`, `beneishMScore`, `sloanAccrualMeasure`, `ohlsonOScore`, `zmijewskiXScore`, `springateSScore`, `tafflerZScore`, `fulmerHScore`, `groverGScore`, `dechowFScoreForMisstatementRisk`, `dechowDichevAccrualQuality`, `modifiedJonesDiscretionaryAccrualModel`. Every module additionally exports `run` as an alias of its primary
function, and a `meta` object carrying its catalog id, domain, family, shape and article URL.

## Verification and provenance

Tier: **verified** (via D).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.0.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/fundamental-analysis-and-valuation/quality-and-distress/piotroski-f-score/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/fundamental-analysis-and-valuation/quality-and-distress/piotroski-f-score/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/llms.txt
