This repository is an A-share index options research workspace. It combines daily option-chain structure, iFind backfilled chain data, VAMP chart research, and MO / CSI1000 intraday options-flow reporting into one local Streamlit app.
The project is for research, visualization, and post-trade review only. It does not place orders and does not output direct buy/sell instructions.
The current repo is organized around three workflows:
- VAMP Research Lab: aggregates iFind option chains into daily market-state factors, VAMP charts, signal diagnostics, and event-study rankings.
- Options Playbook: preserves the original daily options engine for regime state, gamma walls, volatility surface, trigger levels, alerts, and Markdown reports.
- MO Intraday Flow Radar: turns minute-level MO option-chain data into intraday flow, wall movement, OI attribution, synthetic forward, charts, CSVs, and a Markdown report.
Run the combined UI from the repository root:
python -m streamlit run app.pyThen open:
http://127.0.0.1:8501
The repo currently includes normalized iFind option-chain parquet data and generated research outputs.
Normalized daily chains:
| Product | Dates | Range | Rows |
|---|---|---|---|
| CSI1000 / MO | 105 | 2026-01-05 to 2026-06-23 | 27,546 |
| CSI300 / IO | 105 | 2026-01-05 to 2026-06-23 | 23,686 |
| SSE50 / HO | 105 | 2026-01-05 to 2026-06-23 | 17,558 |
Key generated data files:
cem_options_engine/data/options_ifind/normalized_chain/
cem_options_engine/output/2026-06-23_ifind_realtime_options_full.csv
cem_options_engine/output/2026-06-23_ifind_realtime_options_full.parquet
cem_options_engine/output/2026-06-23_ifind_latest_chain_summary.csv
cem_options_engine/output/2026-06-12_CSI1000_ifind_high_frequency_options_complete.csv
mo_flow_radar/output/2026-06-12_MO_flow_report.md
The 2026-06-12 MO intraday file covers the CSI1000 / MO minute-level chain from 09:30 through 15:00.
app.py # Streamlit landing page and data inventory
pages/
1_VAMP_Research_Lab.py # VAMP charts, factors, signal diagnostics
2_Options_Playbook.py # Daily options-engine reports and tables
3_MO_Flow_Radar.py # MO intraday flow report, charts, tables
src/vamp/ # VAMP data loading, aggregation, factors, plots
cem_options_engine/
main.py # Daily options playbook engine
scripts/fetch_latest_ifind_chains.py
data/options_ifind/ # Normalized iFind chain partitions
output/ # Generated daily reports and iFind snapshots
docs/ifind_data_workflow.md # Current iFind pull workflow
mo_flow_radar/
main.py # MO intraday flow radar CLI
src/ # Loader, cleaner, flow metrics, walls, forward, plots
output/ # Generated MO flow CSV / PNG / Markdown outputs
tests/ # Focused unit tests
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txtThe root requirements.txt installs the Streamlit app dependencies and reuses cem_options_engine/requirements.txt.
Credentials must stay outside Git. Use local environment variables or a private secret manager only.
SDK provider, preferred when the local iFinD terminal / SDK entitlement is available:
$env:IFIND_USERNAME="your_username"
$env:IFIND_PASSWORD="your_password"
python cem_options_engine\scripts\fetch_latest_ifind_chains.py --date 2026-06-23 --provider sdk --products SSE50,CSI300,CSI1000 --months 6 --range-pct 0.30
Remove-Item Env:\IFIND_USERNAME
Remove-Item Env:\IFIND_PASSWORDHTTP token provider, only when the iFind Quant API device entitlement is active:
$env:IFIND_REFRESH_TOKEN="your_refresh_token"
python cem_options_engine\scripts\fetch_latest_ifind_chains.py --date 2026-06-23 --provider http
Remove-Item Env:\IFIND_REFRESH_TOKENFetcher outputs:
cem_options_engine/data/options_ifind/normalized_chain/product_group={SSE50|CSI300|CSI1000}/trade_date=YYYY-MM-DD/data.parquet
cem_options_engine/output/YYYY-MM-DD_ifind_realtime_options_full.csv
cem_options_engine/output/YYYY-MM-DD_ifind_realtime_options_full.parquet
cem_options_engine/output/YYYY-MM-DD_ifind_latest_chain_summary.csv
See cem_options_engine/docs/ifind_data_workflow.md for the detailed workflow.
Loads normalized option-chain partitions, aggregates them to daily state, generates VAMP factor columns, plots selected factors, marks technical events, and ranks signal combinations by forward-return / volatility diagnostics.
Typical use:
- choose product group such as
CSI1000 - choose date range
- choose a VAMP factor
- inspect chart, recent event table, ranking table, and interpretation
Displays generated files from cem_options_engine/output/:
- daily Markdown report
- metrics CSV
- key levels CSV
- data quality CSV
This is the original daily options-engine workflow: regime state, gamma walls, volatility structure, triggers, invalidation, sizing bias, alerts, and postmortem fields.
Displays generated files from mo_flow_radar/output/:
- MO intraday Markdown report
- call / put volume and amount PCR charts
- OI-by-strike and volume-by-strike charts
- call wall / put wall timeline
- synthetic forward by expiry
- flow-event and wall CSV tables
Flow labels are proxy classifications based on volume, amount, price change, and OI change. They include confidence fields and should not be read as confirmed dealer inventory.
Daily options playbook:
cd cem_options_engine
python main.py --date 2026-06-12 --all --config config.yaml.exampleMO intraday flow radar:
python mo_flow_radar\main.py `
--input cem_options_engine\output\2026-06-12_CSI1000_ifind_high_frequency_options_complete.csv `
--previous-eod cem_options_engine\data\options_ifind\normalized_chain\product_group=CSI1000\trade_date=2026-06-11\data.parquetThe --previous-eod baseline is important for OI attribution. Without it, the radar falls back to intraday-open OI change and marks the weaker basis in the outputs.
For README-only edits, no runtime test is required. For code changes, use:
python -m compileall app.py pages src
python -m pytest mo_flow_radar\tests -qStreamlit smoke check:
python -m streamlit run app.py- No automatic trading.
- No direct buy/sell recommendations.
- iFind credentials and tokens must not be committed.
- Dealer gamma, Vanna / Charm, wall strength, and flow labels are estimates from available chain data.
- Without bid / ask, IV history, Greeks, and underlying minute prices, intraday flow classification remains a proxy.
- If open interest is only updated at end of day, MO Flow Radar automatically degrades to EOD-only OI analysis.