AlphaPilot Quant is an open-source AI quant trading workbench. It combines market data ingestion, factor research, signal-based stock selection, simulated auto trading, portfolio rebalancing, and risk monitoring in a local React + TypeScript application.
The project is built for research, demos, education, and prototype validation. It defaults to simulated trading and does not connect to a live broker gateway.
- Data center: Tencent Securities quote crawling, scheduled data sync, local JSONL warehouse snapshots, data source registry, provider configs, subscriptions, quality checks, and aggregation insights.
- Research workspace: configurable factor formulas, factor calculation, strategy library, strategy toggles, strategy optimization, and MiroFish-style market scenario simulation adapter.
- Signal selection: ranks tradable A-share and ETF quotes with factor bias, momentum, liquidity, and position constraints.
- Auto trading loop: generates simulated buy/sell orders from signals, handles stop-loss, take-profit, overweight trimming, cash balance, and mock fills.
- Trading calendar guard: exposes the current A-share trading session, holiday reason, next open time, and blocks mock fills outside continuous auction sessions.
- Backtesting and analytics: task creation, execution progress simulation, result analysis, attribution, and stress scenarios.
- Risk management: VaR, ES, drawdown, leverage, concentration, rule toggles, and audit logs.
- One-click workflow: runs data sync, quality checks, factor calculation, MiroFish simulation, strategy optimization, backtesting, signal selection, auto trading, and risk refresh.
- Local REST API: all UI actions go through
/api/*and persist state todata/state.json.
- React 18
- TypeScript
- Vite
- Node HTTP server
- Local JSON persistence
- lucide-react icons
npm install
npm run devDefault URLs:
- Web app:
http://localhost:5173/ - API:
http://localhost:8787/
Build:
npm run buildCopy .env.example if you want to customize ports or scheduled auto trading:
cp .env.example .envUseful variables:
API_PORT: API server port. Default:8787.AUTO_TRADER_INTERVAL_MS: interval for scheduled auto trading. Default:0, disabled.AUTO_DATA_SYNC_INTERVAL_MS: interval for scheduled data crawling and sync. Default:0, disabled.AUTO_TRADER_SYNC_MARKET: set tofalseto skip market sync in scheduled runs.
Example:
AUTO_TRADER_INTERVAL_MS=60000 npm run apiRead endpoints:
GET /api/stateGET /api/data-sourcesGET /api/data-provider-configsGET /api/data-subscriptionsGET /api/data-sync-runsGET /api/data-aggregate-insightsGET /api/data-warehouseGET /api/factorsGET /api/factor-configsGET /api/mirofish/configGET /api/mirofish/scenariosGET /api/strategiesGET /api/strategy-optimizationsGET /api/backtestsGET /api/backtest-resultsGET /api/market-quotesGET /api/trading/sessionGET /api/stock-signalsGET /api/auto-trade-runsGET /api/ordersGET /api/positionsGET /api/risk-indicatorsGET /api/logs
Action endpoints:
POST /api/data/pipelinePOST /api/data/quality-checkPOST /api/data-warehouse/refreshPOST /api/data-warehouse/compactPOST /api/data-provider-configsPATCH /api/data-provider-configs/:id/togglePOST /api/data-subscriptionsPATCH /api/data-subscriptions/:id/togglePATCH /api/data-sources/:id/subscriptionPOST /api/factors/computePOST /api/factorsPATCH /api/factors/:id/togglePOST /api/factor-configsPATCH /api/factor-configs/:id/togglePOST /api/mirofish/configPOST /api/mirofish/scenariosPOST /api/mirofish/advancePOST /api/mirofish/scenarios/:id/publish-factorPOST /api/strategiesPATCH /api/strategies/:id/togglePOST /api/strategies/optimizePOST /api/backtestsPOST /api/backtests/advancePOST /api/signals/selectPOST /api/trading/autoPOST /api/ordersPOST /api/orders/executePATCH /api/orders/:id/cancelPATCH /api/positions/:id/rebalancePOST /api/risk/refreshPOST /api/risk-rulesPATCH /api/risk-rules/:id/togglePOST /api/workflow/runPOST /api/system-config
Auto trading request example:
{
"strategyId": "s-1",
"execute": true,
"minScore": 68,
"maxOrders": 3
}server/ Local REST API and market data ingestion
src/ React app and quant engine
data/state.json Local runtime state, ignored by git
data/warehouse/ Local JSONL warehouse snapshots, ignored by git
dist/ Production build output, ignored by git
AlphaPilot Quant includes an adapter-style workflow inspired by MiroFish market scenario simulation. It does not copy or vendor MiroFish source code. If you connect a full external MiroFish service, review its AGPL-3.0 license obligations separately.
This project is not investment advice and is not production trading infrastructure. Market data can be delayed, unavailable, or inaccurate. The auto trading workflow is simulated by default; live trading requires a separately reviewed broker gateway, credentials management, audit controls, and compliance checks.
Contributions are welcome. See CONTRIBUTING.md for the development workflow.
Please do not open public issues for sensitive security reports. See SECURITY.md.
MIT. See LICENSE.