Skip to main content

Price-time synthetic stock market simulator with visible-only corpus output and market-screen plots.

Project description

Market Wave

Market Wave is a latent-field synthetic stock market simulator backed by a deterministic price-time matching engine. It generates visible-only public market messages, reconstructable snapshots, internal sidecars, simple JSON views, structural validation reports, deterministic replay checks, and market-screen plots.

Contract

  • Runtime randomness exists only in sample_market_message().
  • Internal prices are integer ticks. Internal quantities are integer units.
  • Crossed or locked books are structurally impossible in the matching engine.
  • Public corpus never contains hidden fields, generator parameters, labels, targets, returns, future columns, or ticker symbols.
  • Public messages are typed: ORDER_ACCEPTED, TAKE_ORDER, ORDER_CANCELED, ORDER_REPLACED, TRADE, and BOOK_DELTA.
  • Aggressive flow is explicit. TAKE_ORDER walks resting liquidity and never rests; passive ORDER_ACCEPTED messages may rest or partially execute.
  • Snapshots are reconstructable from the initial full visible ladder and ordered public BOOK_DELTA events.
  • Public world_id is not derived from seed or theta. Use --world-index or --world-id for public identity.
  • Internal artifacts are written under internal/, outside the trainable corpus.
  • Visualization reads visible corpus files only. Price charts are built from trades, candles, volume, best bid/ask, and mid. Top-10 orderbook heatmaps use fixed quote levels on the y-axis and time on the x-axis.
  • Visual output uses a white/cool-gray trading-screen theme with blue/red contrast for bid/ask and buy/sell. Warm-tone page backgrounds, violet accents, and dark terminal themes are out of contract.

CLI

market-wave generate out --seed 7 --steps 500 --price 71800 --tick 100 --force
market-wave validate out
market-wave replay --seed 7 --steps 500
market-wave price out
market-wave book out
market-wave trades out --limit 100
market-wave candles out --interval 1m
market-wave events out --limit 100 --cursor 0
market-wave plot out
market-wave inspect out

Output Layout

out/
  corpus/
    manifest.json
    visible_market_stream.jsonl
    visible_snapshot_stream.jsonl
  internal/
    hidden_sidecar.jsonl
    theta_manifest.jsonl
    run_manifest.json
  plots/
    market_screen.png
    price_chart.png
    orderbook_panel.png
    event_tape.png
    mid_spread_depth.png
    depth_heatmap.png
    top10_orderbook_heatmap.png

Only corpus/ is training input. internal/ is for replay and debugging.

Python API

The top-level Python API is intentionally small: generate, open, and Market.

import market_wave as mw

market = mw.generate("out", seed=7, steps=500, price=71_800, tick=100, force=True)
market.validate()
market.plot()

market.price()
market.book(levels=10)
market.trades(limit=100)
market.candles("1m")
market.events(limit=100, cursor=0)

same_market = mw.open("out")

Project details


Download files

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

Source Distribution

market_wave-1.0.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

market_wave-1.0.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file market_wave-1.0.0.tar.gz.

File metadata

  • Download URL: market_wave-1.0.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for market_wave-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5fbf75f8fcbb39a236b05cf4b51d3d5b075e6c5bff57b2994a81d26fd33fdbd7
MD5 0ed2cc69393611510f5f641ac0ad264b
BLAKE2b-256 1dc049a78d05115731ed56396c034aef2d3076925ebd14946e749a2bc9585d81

See more details on using hashes here.

Provenance

The following attestation bundles were made for market_wave-1.0.0.tar.gz:

Publisher: workflow.yml on smturtle2/market-wave

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

File details

Details for the file market_wave-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: market_wave-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for market_wave-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 753b350aae8f4435be9ef619f332c4b712c5154d446be974e4f174f02a708561
MD5 7101b516fd64e85daf05e0f617e59385
BLAKE2b-256 f53eaa52e14f060dc7db64f5ff74af2bd34b16a26d93582ff922fe52443aeb2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for market_wave-1.0.0-py3-none-any.whl:

Publisher: workflow.yml on smturtle2/market-wave

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