Skip to main content

MarketMind

CI Documentation PyPI Python License

Research software for measuring the market as a changing information network.

MarketMind turns the methodology of Layan Oraidi's 2026 Charles H. Dow Award paper, The Emergent Market Mind: Detecting Self-Organizing Intelligence in Financial Markets Through Multiscale Information Networks, into a tested Python package.

It combines three dimensions into the Market Intelligence Index (MII):

Dimension Measures MII weight
Memory DFA Hurst exponent, Higuchi fractal dimension, absolute-return ACF decay 0.35
Information flow 20-bin Shannon entropy, Kraskov mutual information and transfer entropy 0.40
Connectivity Correlation strength, weighted clustering, correlation-distance MST 0.25

MII is then classified into low, medium, and high states using lower and upper terciles learned from the preceding three years and refreshed monthly. Every estimator and classification decision uses information available at that date only.

Installation

pip install marketmind

Optional capabilities are isolated so the research core stays lightweight:

pip install "marketmind[data]"       # public yfinance adapter
pip install "marketmind[dashboard]"  # Streamlit + Plotly
pip install "marketmind[all]"        # development, docs, data, dashboard

Sixty-second example

from marketmind import MarketMind, MarketMindConfig
from marketmind.synthetic import synthetic_market

prices = synthetic_market(periods=1_500, assets=8, seed=42)

model = MarketMind(
    MarketMindConfig(
        window=252,
        step=21,
        entropy_bins=20,
        knn_k=3,
    )
)
result = model.fit_transform(
    prices[["SPX", "NDX", "SX5E", "ES"]],
    network_data=prices,
)

print(result.to_frame().tail())

To run a completely offline, deterministic end-to-end example:

marketmind demo --output artifacts/demo

The command writes the input data, SHA-256 provenance manifest, raw metrics, normalized metrics, MII states, and exact run configuration.

Walk-forward indicator evaluation

from marketmind.backtest import WalkForwardEvaluator
from marketmind.indicators import all_signals

asset = "SPX"
signals = all_signals(prices[asset])
evaluation = WalkForwardEvaluator(cost_bps=5).evaluate(
    prices[asset].pct_change(),
    signals,
    regimes=result.regimes["regime"],
)

print(evaluation.summary[["sharpe", "max_drawdown", "trades"]])

The included signal library implements the paper's nine fixed, long-only definitions: three trend, three mean-reversion, and three breakout/volatility-expansion signals. Orders execute with a one-session lag. Turnover costs and slippage are charged explicitly.

What is included

  • Paper-aligned fractal and information-theoretic estimators
  • Dependency-free dynamic weighted graphs and Prim MSTs
  • Causal MII normalization and rolling regime thresholds
  • Nine classical technical signals with fixed parameters
  • Cost-aware walk-forward evaluation and regime comparison tests
  • Buy-and-hold, cash, lag-sign, and exposure-matched shuffled baselines
  • Moving-block intervals, White-style reality check, and deflated Sharpe probability
  • YAML-driven public-data adapter, checksums, manifests, and complete run artifacts
  • Streamlit dashboard, command-line interface, notebooks, MkDocs site, and typed API
  • CI across Python 3.10–3.13 and OIDC-based PyPI release automation
  • CITATION.cff, CodeMeta, and Zenodo metadata for software citation

Reproducing the paper responsibly

The paper used Bloomberg for SPX, NDX, VIX, and continuous ES; Refinitiv for SX5E; Yahoo Finance for sector ETFs; and FRED for ancillary robustness data. Bloomberg and Refinitiv snapshots cannot be redistributed in this repository.

config/paper-public.yml provides a transparent public proxy pipeline through yfinance. It is useful for methodological replication, but it should not be represented as a bit-for-bit reproduction of the paper's licensed data. Exact numerical replication requires the original vendor histories and continuous-futures construction.

The primary panel drives memory and information flow; the optional broader network_data panel drives connectivity. This preserves the paper's distinction between the four primary markets and the sector-ETF network universe.

The manuscript also states that submetrics are normalized to [0, 1] without publishing the scaler details. MarketMind makes this choice auditable:

  • normalization="expanding" uses causal expanding min/max bounds;
  • normalization="development" freezes bounds at a declared development_end.

For the paper split, set development_end="2014-12-31"; the 2015–2024 period remains a validation sample, not an untouched third test set.

Dashboard

marketmind-dashboard
# or
marketmind dashboard

Upload a wide price CSV or use the deterministic demo, inspect component histories and regimes, change window/cost assumptions, compare indicator performance, and export the resulting MII series.

Documentation and development

git clone https://github.com/layan985/marketmind.git
cd marketmind
python -m pip install -e ".[all]"
pytest
mkdocs serve

See REPRODUCIBILITY.md for the exact data and analysis workflow. The example notebooks are in examples/notebooks.

Citation

Use the repository's CITATION.cff. A version-specific DOI will be added automatically after the first GitHub release is archived by Zenodo.

Scope

MarketMind is research software, not an execution engine or investment recommendation. Results depend on data provenance, timing conventions, transaction costs, and estimator choices. Users are responsible for independent validation before any real-world use.

License

BSD 3-Clause. Copyright © 2026 Layan Oraidi.

Download files

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

Source Distribution

marketmind-0.1.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

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

marketmind-0.1.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for marketmind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c3bc1207e1a17d79b6e33fdc5723a9938f2656f6eeb931f630b2230afc432c7
MD5 61b441edaf3c84ee0aec27a81da28c26
BLAKE2b-256 19f1fd402905dc0eab1817065430c462d5621eb6e7f33eea63fcd06263900e60

See more details on using hashes here.

Provenance

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

Publisher: release.yml on layan985/marketmind

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

File details

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

File metadata

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

File hashes

Hashes for marketmind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c36ef9c21bb813a502eaedca798a7b5bbb0529c6dbddc4eeb76ec19ab718e20b
MD5 939080081edb8ef2105350682a1d5243
BLAKE2b-256 7bb0fab527442d7b17285986a552090ee8474ae24d1caabdf1027914556dfec7

See more details on using hashes here.

Provenance

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

Publisher: release.yml on layan985/marketmind

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

Supported by

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