Skip to content

Add pre-trade market state verification to StockTradingEnv #1412

Description

@LembaGang

Hi,

I saw FinRL and noticed StockTradingEnv uses datetime for scheduling but doesn't verify whether the exchange is actually open at execution time. That's the gap that causes silent failures when agents trade into closed markets or hit DST transitions.

I've been building Headless Oracle — a signed market oracle for AI agents. Before your agent executes, it fetches an Ed25519-signed attestation that the market is open. 60-second TTL, 28 exchanges.

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 for /v5/demo). pypi.org/project/headless-oracle has LangChain and CrewAI tools built in.

Would you be open to adding a pre-trade market gate to the RL environment? Happy to write it.

— Mike (headlessoracle.com)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions