refactor: remove mock trading functionality from backend and frontend

Removes all mock price simulation features:
- Delete MockPriceManager from backend/data/
- Remove mock_mode, enable_mock, is_mock_mode flags from services
- Remove mock CLI options and config
- Remove mock mode UI components and state from frontend
- Update tests to remove mock references

Now system supports only live and backtest modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 13:38:51 +08:00
parent fecf8a9466
commit 9bcc4221a4
21 changed files with 56 additions and 709 deletions

View File

@@ -111,7 +111,6 @@ class Gateway:
host=host,
port=port,
poll_interval=self.config.get("poll_interval", 10),
mock=self.config.get("mock_mode", False),
tickers=self.config.get("tickers", []),
initial_cash=self.storage.initial_cash,
start_date=self._backtest_start_date or "",
@@ -125,10 +124,6 @@ class Gateway:
self.state_sync.update_state("status", "initializing")
self.state_sync.update_state("server_mode", self.mode)
self.state_sync.update_state("is_backtest", self.is_backtest)
self.state_sync.update_state(
"is_mock_mode",
self.config.get("mock_mode", False),
)
self.state_sync.update_state("tickers", self.config.get("tickers", []))
self.state_sync.update_state(
"runtime_config",
@@ -545,13 +540,13 @@ class Gateway:
websocket: ServerConnection,
data: Dict[str, Any],
) -> None:
"""Run one live/mock trading cycle on demand."""
"""Run one live trading cycle on demand."""
if self.is_backtest:
await websocket.send(
json.dumps(
{
"type": "error",
"message": "Manual trigger is only available in live/mock mode.",
"message": "Manual trigger is only available in live mode.",
},
ensure_ascii=False,
),