- Allow users to modify SystemPromptTemplate when editing Trader
- Enable dynamic strategy switching (default/aggressive/conservative)
- Support A/B testing of different trading strategies
- Maintain backward compatibility with existing data
- Complete full data flow from database through UI to persistence
- Allow users to customize AI decision scan interval (1-60 minutes)
- Default 3 minutes, recommended range 3-10 minutes
- Support both high-frequency and low-frequency trading strategies
- Improve trading flexibility and API call efficiency
- Merge with existing actual balance query functionality
- Add Telegram channel monitoring for market news
- Integrate news sentiment into AI decision making
- Improve context awareness for trading decisions
- Fix missing InsideCoins field in ConfigFile structure
- Merge with existing partial_close and position tracking features
- Add position_snapshots table to track all closed positions
- Record both manual and auto-closed positions
- Fix data integrity issue where auto-closed positions were not recorded
- Improve trade history tracking and analysis
- Merge with existing partial_close functionality
- Fix AI model validation failure when editing trader
- Fix 4h kline data storage to correct database field
- Remove improper model ID conversion in API layer
- Resolve conflicts: keep complete model ID and continue on 4h fetch error
- Closes NoFxAiOS#335, NoFxAiOS#260
- Clean up remaining conflict markers in SetMarginMode
- Add visual warnings for WebSocket stream limits in UI
- Prevent user from exceeding 250 symbols (1024 streams / 4 timeframes)
Optimized mobile display for AITradersPage:
- Header: Reduced padding (px-3 on mobile), smaller icons and text
- Action buttons: Smaller on mobile (px-3, text-xs) with horizontal scroll support
- Configuration cards: Responsive padding (p-3 on mobile), smaller gaps
- Model/Exchange items: Smaller icons (w-7 on mobile), truncate text overflow
- Trader list: Stack vertically on mobile, smaller buttons with wrapping support
- Empty states: Smaller icons and text on mobile
Maintained all i18n translations and preserved Binance design style.
Addresses #311🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This is a partial fix for issue #311 mobile display problems.
Changes in this commit:
- Add responsive header layout with separate mobile/desktop views in App.tsx
- Fix language selector visibility on mobile (no longer hidden by menu)
- Add responsive breakpoints to ComparisonChart stats grid (2 cols on mobile, 4 on desktop)
- Adjust padding and text sizes for mobile screens
- Preserve all i18n (internationalization) functionality from upstream
Note: Additional components (CompetitionPage, AITradersPage) will need similar mobile
responsive improvements in follow-up commits.
Related to #311🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix leverage config visibility issue
- Ensure all symbols' leverage info in prompt
- Prevent AI from using wrong leverage
- Add per-symbol leverage information to decision context
Source: https://github.com/NoFxAiOS/nofx/pull/318
- Auto-sync server time every 30 seconds
- Add callWithTimeSync retry mechanism for all API calls
- Fix -1021 timestamp errors automatically
- Production-ready implementation
- Resolved merge conflict with PR #145
Source: https://github.com/NoFxAiOS/nofx/pull/313
Fixed critical bug where 4h kline data was incorrectly stored with
3m kline data, causing data mismatch.
Changes:
- Changed `m.klineDataMap4h.Store(s, klines)` to `klines4h`
- Updated log message to use `len(klines4h)` instead of `len(klines)`
This bug would cause 4h kline queries to return 3m data, leading to
incorrect technical indicator calculations.
Fixes: #260
Related: #176
1. Rename `traderRecord` to `trader` in handleCreateTrader
- Aligns with upstream naming convention (nofxaios/dev)
- Line 403: variable definition
- Line 424: CreateTrader call
2. Add Binance server time synchronization (PR #145 simple fix)
- Fixes timestamp errors (code=-1021)
- Sets UseTestnet=false (ensure production network)
- Syncs server time on trader initialization
- Based on commit 64299c1 from pr-145 branch
Both changes improve compatibility with upstream and prevent
timestamp-related API failures.
Problem:
- Users could input arbitrary initial balance when creating traders
- This didn't reflect the actual available balance in exchange account
- Could lead to incorrect position sizing and risk calculations
Solution:
- Before creating trader, query exchange API for actual balance
- Use GetBalance() from respective trader implementation:
* Binance: NewFuturesTrader + GetBalance()
* Hyperliquid: NewHyperliquidTrader + GetBalance()
* Aster: NewAsterTrader + GetBalance()
- Extract 'available_balance' or 'balance' from response
- Override user input with actual balance
- Fallback to user input if query fails
Changes:
- Added 'nofx/trader' import
- Query GetExchanges() to find matching exchange config
- Create temporary trader instance based on exchange type
- Call GetBalance() to fetch actual available balance
- Use actualBalance instead of req.InitialBalance
- Comprehensive error handling with fallback logic
Benefits:
- ✅ Ensures accurate initial balance matches exchange account
- ✅ Prevents user errors in balance input
- ✅ Improves position sizing accuracy
- ✅ Maintains data integrity between system and exchange
Example logs:
✓ 查询到交易所实际余额: 150.00 USDT (用户输入: 100.00 USDT)
⚠️ 查询交易所余额失败,使用用户输入的初始资金: connection timeout
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Address DaDaManMan's error where AI set stop-loss incorrectly for short position.
## Problem
AI attempted to set stop-loss at $107,500 for SHORT position at $108,230,
causing validation error: "空单止损必须高于当前价格"
Root cause: Prompts lacked explicit guidance on stop-loss direction logic.
## Solution
### adaptive.txt (Chinese):
- Add "止损方向逻辑" section with clear rules
- Long position: stop_loss < entry_price (protect downside)
- Short position: stop_loss > entry_price (protect upside)
- Include examples and common mistakes to avoid
### nof1.txt (English):
- Add "Stop-Loss Direction Logic" section
- Same directional rules with detailed explanations
- Include real error example from production logs
- Emphasize validation failures when rules are violated
## Impact
- ✅ Prevents AI from setting illogical stop-loss prices
- ✅ Reduces validation errors and failed trades
- ✅ Provides clear examples with entry/stop-loss pairs
- ✅ Addresses DaDaManMan's reported issue directly
## Files Changed
- prompts/adaptive.txt (+19 lines)
- prompts/nof1.txt (+25 lines)
Fixes: #272 (DaDaManMan's comment)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing CardProps interface definition
- Fix TestimonialCard to use 'authorName' instead of 'author'
- Resolves TypeScript compilation error: 'Cannot find name CardProps'
- Fixes frontend build failure in CI
Fixes the type error:
src/components/landing/CommunitySection.tsx(32,16): error TS2304: Cannot find name 'CardProps'.
- Replace log.Printf() with log.Print() for static strings
- Fix 6 instances in trader/auto_trader.go (lines 262, 264, 351, 355, 359, 363)
- Eliminates 'non-constant format string' warnings from go vet
- No functional changes, output remains identical
This follows Go best practices and improves code security by using
appropriate logging functions for non-formatted strings.