Skip to main content

OptionChainAnalytics

OptionChainAnalytics provides point-in-time option-chain containers, feed normalisation, chain reconstruction, queries, and visualisation in Python for quantitative research.

It is the data-container layer: provider retrieval, pricing models, portfolio backtests, and proprietary datasets remain separate. Pricing and implied-volatility inversion are delegated to vanilla-option-pricers; generic time-series and plotting utilities come from qis.

Install

OptionChainAnalytics requires Python 3.10 or newer. CI covers Python 3.10 through 3.14.

Install the published package:

pip install option-chain-analytics

For development from a clone:

pip install -e .

Provider-specific integrations are optional:

Extra Capability
vlad Local Arrow/Feather Vlad fitted-chain files
deribit Deribit HTTP collection helpers
yahoo Yahoo snapshots and the fitter used by that adapter
ccxt CCXT market-data integration
bloomberg Bloomberg retrieval through bbg-fetch
fitters CVXPY-based quote fitting
docs, dev, all Documentation, contributor tooling, or every optional integration

For example, pip install "option-chain-analytics[vlad]" installs the Vlad file dependency without installing unrelated network providers.

First success: no data or credentials

The authoritative offline example constructs a deterministic Black-Scholes-Merton option panel, reconstructs a historical chain, queries its front-expiry ATM strike and volatility, and selects a weekly roll maturity:

python examples/first_success.py

Expected evidence:

ticker=SYNTH
observation_times=2
contracts_at_first_time=30
expiries=['12Jan2024', '19Jan2024', '16Feb2024']
first_expiry_atm=100.00, vol=0.2057
weekly_roll_expiries=['12Jan2024']

See examples/first_success.py for the executable source. The documentation includes that file directly, so the tutorial cannot drift into a second implementation.

Data model

  • OptionsDataDFs holds an option-observation panel (chain_ts) plus an aligned spot-price frame.
  • SlicesChain reconstructs all available expiries at one exact observation time.
  • ExpirySlice provides call/put, ATM, delta-strike, volatility, open-interest, and execution-price queries for one expiry.
  • SliceColumn defines the common option-feed schema, including source time, contract, forward, discount factor, strike, expiry, quote, implied volatility, Greeks, volume, and open interest.

Observation and expiry timestamps are timezone-aware. Exact lookup is the reconstruction default; scheduled studies can explicitly select the latest previous observation, but never a later one. Volatilities are decimals (0.20 means 20%), time to maturity is in years, and each adapter must preserve and document its price/multiplier convention.

Empirical feeds

Local adapters cover Deribit/Tardis crypto histories and SPX/VIX Vlad fitted-chain files. These datasets are not distributed. Set OCA_DATA_PATH to an ignored local data root; generated output uses OCA_OUTPUT_PATH. Vlad files can be mapped with:

from option_chain_analytics import OptionsDataDFs
from option_chain_analytics.ts_loaders import load_local_vlad_options_data

options_data = OptionsDataDFs(
    **load_local_vlad_options_data(
        ticker='SPX',
        start='2023-01-03',
        end='2023-01-03',
    )
)

The Vlad mapper always infers bid/ask implied volatilities from the source bid/ask prices using the contemporaneous forward, discount factor, and time to maturity. This keeps every Vlad-backed OptionsDataDFs instance on the same complete schema.

For repeated empirical studies, build one normalized Parquet cache per underlying after installing the vlad extra:

from option_chain_analytics.ts_loaders import build_local_cboe_options_cache

build_local_cboe_options_cache(ticker='SPX')
build_local_cboe_options_cache(ticker='VIX')

This creates ignored vlad_vols/spx_options_oca.parquet and vlad_vols/vix_options_oca.parquet files. The normal loader uses a valid cache automatically and still accepts start/end filters. OCA embeds its cache schema and source-file fingerprint in each Parquet file and rejects stale caches. Use overwrite=True to rebuild deliberately.

Vlad data supplies implied forwards but no independent spot series. Pass spot_data, or use is_use_front_forward_as_spot=True only for visualisation; a forward proxy is not a valid spot return series for backtesting.

The Bloomberg BVOL-to-synthetic-option mapping remains a TODO: it must define maturity rolling and price generation before BVOL surfaces can be represented as option panels.

Documentation and development

Start with the documentation site, then read the schema contract, point-in-time reconstruction, and data-source guide.

pytest -q
ruff check src tests examples tools docs/conf.py
sphinx-build -W -b html docs docs/_build/html
python -m build

The installable package lives under src/option_chain_analytics/; repository-only scripts live in examples/. Local datasets, agent reports, and generated outputs live in ignored data/, agents/, and outputs/ directories.

Research and licensing boundary

OCA can provide a public, auditable input layer for empirical studies and replication. Strategy logic and the QF-paper backtests remain in SigmaStrats, and a public example is not expected to reproduce results computed from a private production dataset exactly.

The software is released under the MIT License. Dataset licences and access terms are separate from the software licence. Citation metadata is provided in CITATION.cff, and contribution guidance is provided in CONTRIBUTING.md.

Download files

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

Source Distribution

option_chain_analytics-2.0.1.tar.gz (86.2 kB view details)

Uploaded Source

Built Distribution

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

option_chain_analytics-2.0.1-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

Details for the file option_chain_analytics-2.0.1.tar.gz.

File metadata

  • Download URL: option_chain_analytics-2.0.1.tar.gz
  • Upload date:
  • Size: 86.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for option_chain_analytics-2.0.1.tar.gz
Algorithm Hash digest
SHA256 40b0974d6656d2a2d7f4c0579bc6ac20d6caf84feb7bff96510a70feb5f9903d
MD5 6a457befac391664c8680500a1ce2d2a
BLAKE2b-256 ea082b3db4d4c780f5518badc6ed8f0e78d286f43bfeec09aaf484fc08368a89

See more details on using hashes here.

File details

Details for the file option_chain_analytics-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for option_chain_analytics-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 048b22478b1df7e80022b776b6b9cd100005169d9fdb8351fe85989f4b1bb000
MD5 47e121ee359b3992c55610b62cb9c523
BLAKE2b-256 0f9d04d675e5bef5a7b5928a375a8c91783820b05a2c9bac1b2a2ede8a611339

See more details on using hashes here.

Release history Release notifications | RSS feed

5.0.0

2 files

4.0.0

2 files

3.0.0

2 files

This release

2.0.1 This release

2 files

2.0.0

2 files

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.0.18

1 file

1.0.17

1 file

1.0.16

1 file

1.0.15

1 file

1.0.14

1 file

1.0.13

1 file

1.0.12

1 file

1.0.11

1 file

1.0.10

1 file

1.0.9

1 file

1.0.8

1 file

1.0.7

1 file

1.0.6

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

Supported by

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