How pkjoshi23/moomoo-paper-python works
Moomoo Pilot is a paper-only US-stock trading system with two execution paths: a scheduled Cloud Agent and a local event-driven runtime. The local path receives OpenD market events, evaluates exits and entries, applies synchronous risk checks, and submits simulated orders; offline replay reuses the runtime. A separate deterministic fixture pipeline produces inspectable intents without a broker. The read-only dashboard monitors account and market data. Edges follow excerpts and README statements; unsampled dashboard wiring is represented conservatively.
Main entry points: engine.py Trading engine · daemon.py Runtime launcher · pipeline.py Fixture pipeline · gateway.py OpenD gateway
Components 27
Pilot decisions
- Fixture inputs
moomoo_pilot/fixtures.py - Universe selector
moomoo_pilot/universe.py - Entry strategy
moomoo_pilot/strategy.py - Exit evaluator
moomoo_pilot/exit.py - Risk gate
moomoo_pilot/risk.py - Paper rules
moomoo_pilot/config.py - Order intents
moomoo_pilot/models.py - Fixture pipeline
moomoo_pilot/pipeline.py
Event runtime
- Runtime launcher
moomoo_pilot/daemon.py - OpenD gateway
moomoo_pilot/runtime/gateway.py - Event types
moomoo_pilot/runtime/events.py - Event normalization
moomoo_pilot/runtime/normalize.py - Async event bus
moomoo_pilot/runtime/bus.py - Runtime clock
moomoo_pilot/runtime/clock.py - Trading engine
moomoo_pilot/runtime/engine.py - Session recorder
moomoo_pilot/runtime/recorder.py - Session replay
moomoo_pilot/runtime/replay.py
Managed agent
- Managed Cloud Agent
dashboard/functions/cloud-agents.mjs
Monitoring dashboard
- Read-only dashboard
dashboard/app.js - Dashboard functions
dashboard/functions/handler.mjs - Live data endpoint
dashboard/functions/live.mjs - Agent status endpoint
dashboard/functions/status.mjs
Other components
- Operator
- Moomoo MCP
- Local OpenD
- Paper account
- Dashboard viewer
Connections 31
- Operator → Fixture pipeline: runs fixtures
README.md - Fixture pipeline → Paper rules: checks paper mode
moomoo_pilot/pipeline.py - Fixture pipeline → Fixture inputs: loads quotes
moomoo_pilot/pipeline.py - Fixture pipeline → Universe selector: selects candidates
moomoo_pilot/pipeline.py - Fixture pipeline → Entry strategy: evaluates entries
moomoo_pilot/pipeline.py - Entry strategy → Order intents: returns intents
moomoo_pilot/strategy.py - Runtime launcher → OpenD gateway: starts live gateway
moomoo_pilot/daemon.py - OpenD gateway → Local OpenD: subscribes and trades
moomoo_pilot/runtime/gateway.py - OpenD gateway → Event normalization: normalizes pushes
moomoo_pilot/runtime/gateway.py - Event normalization → Event types: creates events
moomoo_pilot/runtime/normalize.py - OpenD gateway → Async event bus: publishes events
moomoo_pilot/runtime/gateway.py - Runtime launcher → Async event bus: runs event loop
moomoo_pilot/daemon.py - Runtime launcher → Runtime clock: configures clock
moomoo_pilot/daemon.py - Runtime launcher → Trading engine: constructs engine
moomoo_pilot/daemon.py - Runtime launcher → Session recorder: configures recording
moomoo_pilot/daemon.py - Trading engine → Async event bus: consumes events
moomoo_pilot/runtime/engine.py - Trading engine → Exit evaluator: evaluates exits
moomoo_pilot/runtime/engine.py - Trading engine → Risk gate: checks orders inline
moomoo_pilot/runtime/engine.py - Trading engine → Order intents: submits intents
moomoo_pilot/runtime/engine.py - Trading engine → OpenD gateway: sends orders
- Session recorder → Session replay: shares log format
moomoo_pilot/runtime/recorder.py - Session replay → Async event bus: publishes replay events
moomoo_pilot/runtime/replay.py - Session replay → Runtime clock: advances virtual time
moomoo_pilot/runtime/replay.py - Session replay → Trading engine: drives same engine
moomoo_pilot/runtime/replay.py - Managed Cloud Agent → Moomoo MCP: submits simulated orders
README.md - Moomoo MCP → Paper account: acts on paper account
README.md - Operator → Read-only dashboard: views monitoring
README.md - Read-only dashboard → Live data endpoint: requests live data
- Dashboard functions → Live data endpoint: routes requests
dashboard/functions/index.ts - Dashboard functions → Agent status endpoint: routes requests
dashboard/functions/index.ts - Agent status endpoint → Managed Cloud Agent: reads agent status
dashboard/functions/status.mjs