refactor: remove all backtest module code and references

Delete backtest/ engine (19 files), api/backtest.go, store/backtest.go,
web backtest components (7 files), API client, types, docs, screenshot.
Clean all backtest references from main.go, api/server.go, store/store.go,
App.tsx, HeaderBar.tsx, LandingPage.tsx, translations, README and docs.
This commit is contained in:
tinkle-community
2026-03-16 07:38:01 +08:00
parent 1a6b88d77f
commit 21a15f98eb
51 changed files with 37 additions and 11130 deletions

22
main.go
View File

@@ -3,13 +3,11 @@ package main
import (
"nofx/api"
"nofx/auth"
"nofx/backtest"
"nofx/config"
"nofx/crypto"
"nofx/telemetry"
"nofx/logger"
"nofx/manager"
"nofx/mcp"
_ "nofx/mcp/payment"
_ "nofx/mcp/provider"
"nofx/store"
@@ -81,7 +79,6 @@ func main() {
logger.Fatalf("❌ Failed to initialize database: %v", err)
}
defer st.Close()
backtest.UseDatabaseWithType(st.DB(), st.DBType() == store.DBTypePostgres)
// Initialize installation ID for experience improvement (anonymous statistics)
initInstallationID(st)
@@ -98,13 +95,8 @@ func main() {
// time.Sleep(500 * time.Millisecond)
logger.Info("📊 Using CoinAnk API for all market data (WebSocket cache disabled)")
// Create TraderManager and BacktestManager
// Create TraderManager
traderManager := manager.NewTraderManager()
mcpClient := newSharedMCPClient()
backtestManager := backtest.NewManager(mcpClient)
if err := backtestManager.RestoreRuns(); err != nil {
logger.Warnf("⚠️ Failed to restore backtest history: %v", err)
}
// Load all traders from database to memory (may auto-start traders with IsRunning=true)
if err := traderManager.LoadTradersFromStore(st); err != nil {
@@ -132,7 +124,7 @@ func main() {
}
// Start API server
server := api.NewServer(traderManager, st, cryptoService, backtestManager, cfg.APIServerPort)
server := api.NewServer(traderManager, st, cryptoService, cfg.APIServerPort)
// Create hot-reload channel for Telegram bot; wire it to the API server
// so that POST /api/telegram can trigger a bot restart when the token changes.
@@ -163,16 +155,6 @@ func main() {
logger.Info("✅ System shut down safely")
}
// newSharedMCPClient creates a shared MCP AI client (for backtesting)
func newSharedMCPClient() mcp.AIClient {
apiKey := os.Getenv("DEEPSEEK_API_KEY")
if apiKey == "" {
logger.Warn("⚠️ DEEPSEEK_API_KEY not set, AI features will be unavailable")
return nil
}
return mcp.NewAIClientByProvider("deepseek")
}
// initInstallationID initializes the anonymous installation ID for experience improvement
// This ID is persisted in database and used for anonymous usage statistics
func initInstallationID(st *store.Store) {