qlib icon indicating copy to clipboard operation
qlib copied to clipboard

Add real-time market state verification for live execution path

Open LembaGang opened this issue 7 months ago • 0 comments

Hi,

I saw qlib's trade_calendar handles scheduling for backtesting, but for live agent execution it doesn't cover unplanned halts, circuit breakers, or real-time session state. That's the gap that bites when agents go from backtest to production.

I've been building Headless Oracle — a signed market oracle for AI agents. It returns Ed25519-signed receipts confirming an exchange is OPEN, CLOSED, HALTED, or UNKNOWN. 60-second TTL. 28 exchanges. The rule: UNKNOWN must be treated as CLOSED.

import requests

r = requests.get('https://headlessoracle.com/v5/demo?mic=XNYS') receipt = r.json()

if receipt['status'] != 'OPEN': raise Exception(f"Market not open: {receipt['status']}")

Free to try (no key needed). pypi.org/project/headless-oracle

If there's interest in adding a pre-trade verification step to qlib's live execution path, happy to contribute.

— Mike (headlessoracle.com)

LembaGang avatar Apr 07 '26 10:04 LembaGang