feat: Integrated Dashboard v2.0 with LLM-driven Mock Backend

- Promoted prototype dashboard to main app
- Added /api/market-data endpoint
- Implemented market_simulator.py for realistic OHLCV generation
- Updated MoomooClient to serve simulated scenarios
- Wired frontend to backend API
This commit is contained in:
2026-02-07 06:34:19 +08:00
parent dfb7b9e619
commit f30bcdc680
8 changed files with 5796 additions and 47 deletions

View File

@@ -265,7 +265,27 @@ class MoomooClient(DataConnector):
interval = params.get("interval", "1d") if params else "1d"
limit = params.get("limit", 100) if params else 100
# Generate mock OHLCV data
# Try to load LLM-generated scenario first
scenario_file = f"data/mock_scenarios/{symbol}_rally.json"
try:
import os
if os.path.exists(scenario_file):
with open(scenario_file, 'r') as f:
data = json.load(f)
# Filter/slice data if needed
return {
"code": 0,
"msg": "success",
"data": {
"symbol": symbol,
"interval": interval,
"list": data[:limit]
}
}
except Exception as e:
logger.warning(f"Failed to load mock scenario: {e}")
# Fallback to algorithmic generation
data = []
base_price = random.uniform(100, 200)
for i in range(limit):