Skip to main content

cotmetrics

Turn raw COT (Commitments of Traders) data into positioning metrics and trading signals — the positioning index, concentration / clustering / position-size, reversal signals, and the CotIndexer that assembles per-instrument weekly panels.

Split out of cot-analyzer so the metrics layer installs without the Dash/Plotly dashboard stack. Reads prices/COT from the shared cotdata store.

Install (workspace, editable)

pip install -e ../cotdata -e .[options,scheduler,dev]
export COTDATA_STORE=~/code/cotdata_store     # shared data store
export COTMETRICS_CACHE=~/.cache/cotmetrics    # derived per-instrument parquet cache

Use

import cotmetrics                                   # flat metric fns
from cotmetrics.indexer import cotIndexer, boot_options_update
from cotmetrics.signals import append_trading_signals
cotmetrics.calculate_cot_index(...)

import cotmetrics is side-effect-free. Constructing the indexer (from cotmetrics.indexer import cotIndexer) loads the store; the daily options fetch runs only when you call boot_options_update() explicitly.

Config / paths

env meaning default
COTDATA_STORE shared price/COT store (from cotdata) required
COTMETRICS_CACHE derived per-instrument parquet cache ~/.cache/cotmetrics
COTMETRICS_PARAMS instrument/params config packaged sample params.yaml
COTMETRICS_DATA legacy raw_cot_data.parquet + real_test_data exports <cache>/../cotmetrics_data

The packaged params.yaml is a small generic sample (a handful of well-known symbols, untuned 52-week lookbacks) so cotmetrics runs out of the box. For a real instrument universe and any tuned parameters, set COTMETRICS_PARAMS to your own config file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cotmetrics-0.1.0.tar.gz (128.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cotmetrics-0.1.0-py3-none-any.whl (105.4 kB view details)

Uploaded Python 3

File details

Details for the file cotmetrics-0.1.0.tar.gz.

File metadata

  • Download URL: cotmetrics-0.1.0.tar.gz
  • Upload date:
  • Size: 128.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for cotmetrics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04c0965bb69b6d55c420de9ed150a556e91a00c67e59d422dc19e4568aebe98b
MD5 63e8508fbed9c095dae87862a6302d3d
BLAKE2b-256 2f7873bc1cbcebb85e7eccedc646919f0d8de327a702411d72e549d37dc473c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cotmetrics-0.1.0.tar.gz:

Publisher: release.yml on mspinola/cotmetrics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cotmetrics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cotmetrics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 105.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for cotmetrics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af307cb0358a355631eb33710a5398d152ffa63542914b7b7619a47ccf52475a
MD5 b31a7abba9c9d7de56ff8b0feabf2d68
BLAKE2b-256 0da4a7428e37baf794b82a9b0f7074f5cad7e03580ec2a8b9365545d2b00f529

See more details on using hashes here.

Provenance

The following attestation bundles were made for cotmetrics-0.1.0-py3-none-any.whl:

Publisher: release.yml on mspinola/cotmetrics

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page