fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Weighting and Capping

8 algorithms in Index and Benchmark Engineering · 8 with asserted arithmetic.

In this family#

  1. Price-Weighted Index verified

    The Dow construction: sum the prices, divide by a divisor. Weight follows share *price*, not company size — a $500 stock moves it more than a $50 one ten times the size, which is why it tells a different story from the S&P.

    calculate(data)
  2. Total-Market-Cap Index verified

    Weight by full market capitalisation. The textbook construction, and the starting point every float and capping rule modifies.

    calculate(data)
  3. Free-Float Market-Cap Index verified

    Weight by the shares that can actually be bought. Excluding strategic, government and insider holdings is what makes an index replicable — a fund cannot buy shares that are not for sale.

    calculate(data)
  4. Capped Free-Float Market-Cap Index verified

    Float weighting with a ceiling on any single constituent. Regulation and mandate limits require it, and the redistribution is subtler than it looks: capping one name lifts the others, which can push a second name over the cap.

    calculate(data)
  5. Modified Market-Cap Index verified

    Applies an exponent to market value before weighting, compressing the gap between the largest and smallest members. An exponent of 1 is plain cap weighting and 0 is equal weighting; between them is a continuous dial.

    calculate(data)
  6. Equal-Weight Index verified

    Every constituent counts the same. Simple to state and expensive to run: weights drift with prices immediately, so the construction implies continuous rebalancing and materially higher turnover.

    calculate(data)
  7. Iterative Cap Redistribution verified

    The redistribution engine behind every capped index. Cap the offenders, spread the excess across the rest in proportion, repeat until nothing breaches — the loop is necessary because each pass can create new breaches.

    calculate(data)
  8. Group-Level Capping verified

    Caps at two levels at once: each constituent, and each group it belongs to. This is the UCITS 5/10/40 shape, and the two constraints interact — satisfying one can break the other, so both are enforced together.

    calculate(data)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { calculate } from "fintech-algorithms/index-and-benchmark-engineering/weighting-and-capping/price-weighted-index";
import { calculate } from "fintech-algorithms/index-and-benchmark-engineering/weighting-and-capping/total-market-cap-index";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Index and Benchmark Engineering collects 40 algorithms across 6 families. For the concept behind this family rather than the call signatures, see the concept guides.