merge - #1192
Conversation
- Get qtyStep from Bybit API for each symbol and cache it - Format quantity based on actual qtyStep (e.g., BEATUSDT requires integers) - Add missing fields to GetPositions: markPrice, unRealizedProfit, liquidationPrice - Fix panic in buildTradingContext due to nil interface conversion
…ent write - Add OKX trader support in order_sync.go and position_sync.go - Change exchange.Type to exchange.ID for correct exchange identification - Add writeMu mutex to prevent concurrent WebSocket writes in combined_streams.go and websocket_client.go
- Use http.DefaultClient instead of custom client, consistent with Binance/Bybit SDKs - Remove unnecessary noProxyFunc and net/url import - All exchanges now use the same HTTP client behavior
- Remove system_config, beta_codes, signal_source tables and related code - Simplify config.go to only read from .env (APIServerPort, JWTSecret, RegistrationEnabled) - Remove GetCustomCoins, use all USDT perpetual contracts for WSMonitor - Add trader_equity_snapshots table for equity tracking - Remove signal source modal from frontend AITradersPage - Fix WSMonitor nil panic by restoring initialization in main.go
- Add clickable position rows that scroll to chart and update symbol - Add framer-motion animations to chart tab transitions - Sync exchange selection between positions and TradingView chart - Optimize position table layout with compact styling - Update CSS with glass effects and premium button styles
- Remove initDefaultData() for exchanges, ai_models, strategies tables - Change supported exchanges/models API to return static lists - Add GetDefaultStrategyConfig(lang) with Chinese/English prompt templates - Frontend passes language parameter when creating new strategy
- StrategyStudioPage: auto-select new strategy after creation, clear selection after deletion - ModelConfigModal: add loading state and async onSave handling - ExchangeConfigModal: add loading state to prevent duplicate submissions
- Add RawResponse field to FullDecision and DecisionRecord - Save raw AI response to database for debugging parse failures - Add IMPORTANT note in prompt: all numeric values must be calculated numbers, not formulas
- Remove trader_orders table and OrderSyncManager (never worked correctly) - Poll GetOrderStatus to get actual avgPrice, executedQty, and commission - Get entry price from exchange GetPositions API when closing positions - Pass fee to trader_positions table on close - Move TraderStats type to position.go
- Add KlineBar struct with full OHLCV data and timestamp - Store complete kline data in TimeframeSeriesData.Klines - Format klines as readable table with Time, Open, High, Low, Close, Volume - Mark current (latest) bar for clarity - Use kline count from strategy config instead of hardcoded 10 - Keep MidPrices/Volume for backward compatibility - Update both market/data.go and decision/strategy_engine.go formatters
- Fix OITopAPIResponse struct to use Code int (0=success) instead of Success bool
- Add all response fields from actual API (time_range_param, rank_type, limit)
- Add {symbol} placeholder validation warning in FetchQuantData
- Add API-level validation in strategy create/update to warn about missing {symbol}
Backend: - Fix AIModelStore.Update to preserve existing API key when new key is empty (prevents clearing API key when adding a new model) - Add default OI Top API URL to strategy config Frontend: - Add "Fill Default" buttons for Coin Pool, OI Top, and Quant Data URLs - Pre-configured default URLs for all data sources - Users can click to auto-fill with working defaults
Backend: - Add enable_raw_klines field to IndicatorConfig (always true, required) - Change defaults: disable EMA/MACD/RSI/ATR, keep volume/OI/funding enabled Frontend: - Completely redesign IndicatorEditor with 4 clear sections: 1. Market Data: Raw OHLCV (required, locked) + timeframe selection 2. Technical Indicators: EMA/MACD/RSI/ATR (optional, AI can calculate) 3. Market Sentiment: Volume/OI/Funding Rate 4. Quant Data: External API integration - Add helpful tips and descriptions in both Chinese and English - Improve visual hierarchy with section headers and color coding - Auto-ensure enable_raw_klines is always true
When the program restarts, traders that had is_running=true in the database will now automatically start. If a trader fails to run, its status will be updated to false in the database.
…d UI Backend: - Add GetByID method to TraderStore for fetching trader without userID - Calculate total_pnl_pct in equity history API using initial_balance - Falls back to first snapshot equity if initial_balance not set Frontend (ComparisonChart): - Redesign with modern UI: gradient fills, glow effects, rounded corners - Add mini stats bar showing all traders with current PnL - Improved tooltip with date, time, and trend icons - Better Y-axis domain calculation ensuring zero is visible - Bottom stats grid: Leader, Lead PnL, Gap, Data Points - Use ComposedChart with Area + Line for visual depth - Animated loading state with spinning indicator
- Add PunkAvatar component for Web3-style trader avatars - Integrate punk avatars into trader cards and dashboard header - Add official Twitter/Telegram links to footer with anti-fork protection - Create branding.ts with Base64 encoded official links
Frontend now calculates total_pnl_pct from equity values if the backend doesn't return this field. This ensures the performance chart displays correctly regardless of backend version.
|
|
🚨 This PR is large (>18934 lines changed). Please consider breaking it into smaller, focused PRs for easier review. |
🔧 已自动应用专用模板 | Auto-Applied Template检测到您的PR主要包含 backend 相关的变更,系统已自动为您应用相应的模板。 Detected that your PR primarily contains backend changes. The appropriate template has been automatically applied. 文件统计 | File Statistics
已应用模板 | Applied Template ✨ 您现在可以直接在PR描述中填写相关信息了! ✨ You can now fill in the relevant information in the PR description! |
🐳 Docker Build Check ResultsAMD64 builds: ✅ success 🎉 All Docker builds passed!✨ Using GitHub native ARM64 runners - 3x faster than emulation! After merge, full multi-arch builds will run in ~10-12 minutes. Checked: Backend (amd64 + arm64 native), Frontend (amd64) | Powered by GitHub ARM64 Runners |
🤖 Advisory Check ResultsThese are advisory checks to help improve code quality. They won't block your PR from being merged. 📋 PR InformationTitle Format: Recommended formatValid types: Examples:
PR Size: 🔴 Large (18934 lines: +9397 -9537) 💡 Suggestion: This is a large PR. Consider breaking it into smaller, focused PRs for easier review. 🔧 Backend ChecksGo Formatting: Files needing formattingGo Vet: ✅ Good Fix locally: go fmt ./... # Format code
go vet ./... # Check for issues
go test ./... # Run tests⚛️ Frontend ChecksBuild & Type Check: ✅ Success Fix locally: cd web
npm run build # Test build (includes type checking)📖 ResourcesQuestions? Feel free to ask in the comments! 🙏 These checks are advisory and won't block your PR from being merged. This comment is automatically generated from pr-checks-run.yml. |
Pull Request - Backend | 后端 PR
📝 Description | 描述
English: | 中文:
🎯 Type of Change | 变更类型
🔗 Related Issues | 相关 Issue
📋 Changes Made | 具体变更
English: | 中文:
🧪 Testing | 测试
Test Environment | 测试环境
Manual Testing | 手动测试
Test Results | 测试结果
🔒 Security Considerations | 安全考虑
⚡ Performance Impact | 性能影响
If impacted, explain | 如果受影响,请说明:
✅ Checklist | 检查清单
Code Quality | 代码质量
go build)go fmt| 已运行go fmtDocumentation | 文档
Git
devbranch | 已 rebase 到最新dev分支📚 Additional Notes | 补充说明
English: | 中文:
By submitting this PR, I confirm | 提交此 PR,我确认:
🌟 Thank you for your contribution! | 感谢你的贡献!