New advertisers: 50% off your first month with code FIRSTMONTHSee slots
david-marina avatar

Marina rules

david-marina/marina-rules

Structured, point-in-time China/HK/US exchange trading rules with citations and fee and limit-price checks for backtests.

GitHub stars
1
tools
8
transport
STDIO
last updated
Nov 16, 2026
View on GitHub

What it does

  • Reads rules with resolve, limit_price, list_rules, and list_scopes, covering A-share price limits, stamp duty, ticks, and futures margins by trade date
  • Checks work with statutory_fees, coverage, check_fills (up to 500 inline fills), and citation, which pins the dataset version
  • Runs locally as a Python package with the dataset bundled, so no API key or external service is needed
  • Designed for backtest engines and trading agents that need each trade's rules as of its date

Tools

8 tools

Public tool metadata for what this MCP can expose to an agent.

resolveone rule on one trading day for one scope: the decision of `resolve()`, acted on only when `status` is `DETERMINED`

one rule on one trading day for one scope: the decision of `resolve()`, acted on only when `status` is `DETERMINED`

No parameter schema in public metadata yet.

limit_pricelimit-up / limit-down price from the previous close; `unlimited: true` when no daily limit applied

limit-up / limit-down price from the previous close; `unlimited: true` when no daily limit applied

No parameter schema in public metadata yet.

statutory_feesstamp duty and transfer fee of one A-share stock fill, per component and summed (commission not included)

stamp duty and transfer fee of one A-share stock fill, per component and summed (commission not included)

No parameter schema in public metadata yet.

coveragewhether every (rule, day) of a backtest window can be answered for a scope, with the gaps

whether every (rule, day) of a backtest window can be answered for a scope, with the gaps

No parameter schema in public metadata yet.

list_scopesthe scopes of `cn`, `hk` or `us` and the context each requires

the scopes of `cn`, `hk` or `us` and the context each requires

No parameter schema in public metadata yet.

list_rulesthe rule names a scope holds, with their first and last dates

the rule names a scope holds, with their first and last dates

No parameter schema in public metadata yet.

check_fillsthe `marina-check` checks on up to 500 fills passed inline as JSON (not a file path)

the `marina-check` checks on up to 500 fills passed inline as JSON (not a file path)

No parameter schema in public metadata yet.

citationthe citation line and version of the dataset

the citation line and version of the dataset

No parameter schema in public metadata yet.

Readme

Marina — point-in-time trading rules (marina-rules)

Auditable backtests: the exchange trading rules in force on each day, as data with sources.

Price limits, fees, trading sessions, ticks, settlement — every record says when a rule took effect and where it was published. A backtest asks for the rule of each trade date instead of hard-coding today's; marina-check then verifies every fill against the rules of its day and, on a strict pass, emits a stamp that anyone holding the same fill log and the same rules version can recompute; citation() names the exact, byte-pinned rules a result ran under.

What a stamp certifies is deliberately narrow: the fills respected these rules. It says nothing about look-ahead in prices, survivorship or overfitting. as_of closes one more gap: it answers only from rules that had been published by a given date, so a backtest cannot use a rule change before it was announced (a rule whose publication date was not located is refused, not assumed).


View the full README on GitHub

Details

Repository
github.com/david-marina/marina-rules
Website
github.com/David-Marina/marina-rules#ask-from-an-ai-assistant-the-mcp-server
Categories
Finance & Trading, Data & Analytics
Package
marina-rules
Transport
STDIO
Registry
MCP registry, active

Similar to Marina rules

More Finance & Trading