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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user