Skip to main content

price-pinning

CI

Detect stocks whose price has stopped moving, typically because a cash takeover offer pins it to the offer price, from the price series alone.

After a cash offer, a stock's daily moves shrink to a fraction of their usual size while the announcement premium stays in the trailing year. On its own history the stock then looks unusually calm and unusually profitable, and what it really offers is a deal spread. Index providers keep such a stock in the index until the deal closes. This package flags it without event data, filings or manual judgement, so the same call works on the day and in a historical study.

The measure

ratio = median(|daily return|, last 20 days) / median(|daily return|, last 252 days)

computed from closes before the day in question. A ratio at or below 0.30 flags the stock as pinned; the flag clears as soon as the ratio rises above 0.30. Medians, not standard deviations, because a single announcement jump would hold a standard deviation up for weeks.

On 324 US large caps (2025–2026), two cash takeovers were flagged 9 and 14 trading days after the announcement, while other stocks fell below the threshold on 0.017 % of stock-days. On 3,958 series back to 2000, 34 clear cases were flagged after a median of 11 trading days. Decision log with the rejected filing-based approach, calibration, alternatives tested against criteria set in advance, and limits: docs/DECISIONS.md.

Why not read the filings?

Detecting takeovers from SEC filings is the obvious approach, and it was tried first. On 324 US stocks it produced 36 flags, 31 of which needed a person to read the filing, and 2 of 5 stocks classified as targets were wrong. The reasons are in docs/DECISIONS.md (D1). The filing reader that produced this evidence is included as pricepinning.filings (classify, cik_map, header_roles): it reads a company's EDGAR submissions point in time and tells target from acquirer by one-sided evidence. It downloads nothing; the caller passes in the SEC JSON and headers. It is not used by the pinning flag.

Install

pip install git+https://github.com/Elcando-GmbH/price-pinning.git

Python 3.11 or later. The only dependency is pandas.

Use

import datetime as dt
from pricepinning import check, pinning_frame

r = check("XYZ", closes, dt.date(2026, 11, 3))  # closes: pandas Series of daily closes, indexed by date

print(r.status, r.ratio, r.last_close_date, r.note)  # "pinned" | "not_pinned" | "insufficient"

frame = pinning_frame(closes)  # the daily series behind the flag: ratio, range, std ratio

check ignores closes dated on or after the given day. insufficient means fewer than 253 closes. Window lengths and threshold are parameters (short, long, max_ratio).

A runnable example with three synthetic stocks (normal, cash deal, stock deal):

python examples/synthetic.py

Tests

pip install -e ".[dev]"
pytest

All tests run offline.

Known limits

  • The flag comes 9 to 14 trading days after an announcement (median 11 in the wider data).
  • A deal that keeps the price pinned for more than about 126 trading days is no longer flagged: by then the quiet days dominate the one-year reference. Four fixes were tested against criteria set in advance; none passed (DECISIONS.md).
  • Stock and cash-and-stock deals are not flagged while the price moves with the acquirer.
  • Calibrated on two current cases in large caps; the wider check adds 34 historical cases.

Author

Laura Kruse-Stecher, Elcando GmbH.

License

MIT, Copyright (c) 2026 Elcando GmbH. For informational purposes only. Not investment advice.

Metadata

Release files for pricepinning 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pricepinning 0.1.0
File Size Uploaded Provenance Actions
pricepinning-0.1.0.tar.gz 18.3 kB With provenance Details for pricepinning-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pricepinning 0.1.0
File Interpreter ABI Platform Actions
pricepinning-0.1.0-py3-none-any.whl Python 3 none any Details for pricepinning-0.1.0-py3-none-any.whl

Total release size: 29.6 kB

Release files / pricepinning-0.1.0.tar.gz

Download URL pricepinning-0.1.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
48692d5557a4615a4a1f7d63418b47c1e3d903e7c0958ce224e727a2d3d62950
BLAKE2b-256 checksum
How to use checksums
15810fa6e496b69494c84ba027e0a1f7763a548edfa5f870161a1f0f8ce4d8bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / pricepinning-0.1.0-py3-none-any.whl

Download URL pricepinning-0.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e47a2232d2a5fa1d1f1b487b28a2c0cc43c1d2b1901051330c0d834e85ee305
BLAKE2b-256 checksum
How to use checksums
f78af3efbd077a46756cd4b6ec29d2be9b9b8f31d2c31d86800395e974ef9b64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for pricepinning 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pricepinning-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page