Commit Graph

414 Commits

Author SHA1 Message Date
SkywalkerJi
df83a87bb0 Merge pull request #338 from xqliu/feat/add-scan-interval-config-v2
feat: 添加 AI 扫描决策间隔配置支持
2025-11-03 23:11:27 +09:00
SkywalkerJi
0a9410069d Merge pull request #337 from xqliu/fix/trader-edit-model-validation
fix: 修复编辑 Trader 时 AI 模型验证失败的问题
2025-11-03 23:11:08 +09:00
ZhouYongyou
1d785532a0 fix: Fix AI model validation and 4h kline storage (PR #337)
- 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
2025-11-03 22:05:32 +08:00
Liu Xiang Qian
8ad85a4a5b revert: 移除 SystemPromptTemplate 相关修改
将 SystemPromptTemplate 功能从扫描间隔 PR 中分离出来,
保持 PR 单一职责。

SystemPromptTemplate 功能将在单独的 PR 中处理。
2025-11-03 22:02:25 +08:00
ZhouYongyou
b3e97072a9 fix: Remove merge conflict markers and add WebSocket limit warnings
- 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)
2025-11-03 21:57:55 +08:00
Liu Xiang Qian
ddf6c44d65 feat: 添加 AI 扫描决策间隔配置支持
## 功能描述

在创建和编辑 Trader 时,支持配置 AI 扫描决策间隔(scan_interval_minutes),允许用户自定义 AI 决策的频率。

## 修改内容

### 后端修改 (api/server.go)

1. **CreateTraderRequest** 添加 `ScanIntervalMinutes` 字段
2. **UpdateTraderRequest** 添加 `ScanIntervalMinutes` 字段和 `SystemPromptTemplate` 字段
3. **handleCreateTrader** 处理扫描间隔默认值(默认 3 分钟)
4. **handleUpdateTrader** 支持更新扫描间隔
5. **handleGetTraderConfig** 返回中添加 `scan_interval_minutes` 字段

### 前端修改

#### web/src/types.ts
- `CreateTraderRequest` 添加 `scan_interval_minutes?` 可选字段
- `TraderConfigData` 添加 `scan_interval_minutes` 必填字段

#### web/src/components/TraderConfigModal.tsx
- 本地 `TraderConfigData` 接口添加 `scan_interval_minutes`
- 初始状态设置默认值为 3 分钟
- 添加 UI 输入框(范围 1-60 分钟)
- Label 优化为 "AI 扫描决策间隔 (分钟)"

#### web/src/components/AITradersPage.tsx
- `handleSaveEditTrader` 的更新请求中添加 `scan_interval_minutes`

#### web/src/components/landing/CommunitySection.tsx
- 修复 TypeScript 编译错误:定义 `CardProps` 接口
- 修正 `TestimonialCard` 组件的 prop 名称(author → authorName)

## 功能特性

-  支持 1-60 分钟的自定义间隔
-  默认值为 3 分钟
-  UI 提示建议范围:3-10 分钟
-  创建和编辑时均支持配置
-  后端验证和处理默认值

## 测试步骤

1. 创建新 Trader,设置自定义扫描间隔(如 10 分钟)
2. 验证 Trader 创建成功
3. 编辑现有 Trader,修改扫描间隔
4. 验证修改保存成功
5. 确认 AI 决策按照新的间隔执行
2025-11-03 21:55:26 +08:00
Liu Xiang Qian
3dfdd79a8c fix: 修复编辑 Trader 时 AI 模型验证失败的问题
## 问题描述
编辑 Trader 配置时,保存提示"AI模型配置不存在或未启用"错误。

## 根本原因
- 数据库存储的模型 ID 是完整格式(如 `admin_deepseek`)
- API 返回时将其转换为 provider 格式(`deepseek`)
- 前端 enabledModels 列表中是完整 ID
- 导致前端用 `deepseek` 查找 `admin_deepseek` 时失败

## 修复方案
移除 handleGetTraderConfig 中的模型 ID 转换逻辑,
返回完整的模型 ID,保持与前端模型列表格式一致。

Fixes #335
2025-11-03 21:52:44 +08:00
Ember
7a4e9f145c feat(web): comprehensive mobile responsive optimization for AI Traders and Competition pages
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>
2025-11-03 21:46:07 +08:00
Ember
4f4e9f2ca9 fix: improve mobile responsive layout for header and comparison chart
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>
2025-11-03 21:38:52 +08:00
ZhouYongyou
a95faf6552 fix(trader): Correct leverage ratio in AI prompt (PR #318)
- 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
2025-11-03 21:33:30 +08:00
ZhouYongyou
cc9e42859d feat(exchange): Add comprehensive Binance time sync (PR #313)
- 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
2025-11-03 21:33:02 +08:00
Liu Xiang Qian
13e6f9e7f6 fix: Correct 4h kline data storage in WebSocket monitor
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
2025-11-03 21:17:43 +08:00
ZYY | Bobo
381240c222 Merge branch 'NoFxAiOS:dev' into feature/partial-close-dynamic-tpsl 2025-11-03 21:07:09 +08:00
ZhouYongyou
7f87478ee1 refactor: align variable naming and add Binance time sync
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.
2025-11-03 21:03:55 +08:00
ZhouYongyou
a29eea2742 chore(web): add peer dependency markers to package-lock.json
npm v7+ automatically marks packages as peer dependencies. This commit
adds these markers to ensure consistent dependency resolution.

Affected packages (10):
- @babel/core (dev peer)
- @types/react (devOptional peer)
- browserslist
- jiti (dev peer)
- postcss
- react
- react-dom
- picomatch (2 instances, dev peer)
- vite (dev peer)
2025-11-03 20:53:01 +08:00
ZhouYongyou
fd5c28c628 chore(web): add peer dependency markers to package-lock.json
npm v7+ automatically marks packages as peer dependencies when they are
declared in peerDependencies of installed packages. This commit adds
these markers to ensure consistent dependency resolution across all
development environments and CI/CD pipelines.

Affected packages (10):
- @babel/core (dev peer)
- @types/react (devOptional peer)
- browserslist
- jiti (dev peer)
- postcss
- react
- react-dom
- picomatch (2 instances, dev peer)
- vite (dev peer)

Benefits:
- Prevents duplicate installations of peer dependencies
- Ensures consistent package versions across the project
- Improves npm install performance
- Reduces package-lock.json conflicts
2025-11-03 20:47:25 +08:00
tinkle-community
7d1c35be2b Merge pull request #326 from NoFxAiOS/main 2025-11-03 20:34:16 +08:00
SkywalkerJi
61fc2bee16 Merge branch 'dev' into main 2025-11-03 21:33:46 +09:00
ZhouYongyou
4e8af52a24 fix(api): query actual exchange balance when creating trader
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>
2025-11-03 20:30:00 +08:00
ZhouYongyou
041d6d4048 fix(prompts): add explicit stop-loss direction logic for long/short positions
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>
2025-11-03 20:21:47 +08:00
ZhouYongyou
b56b278be1 fix: resolve go vet warnings for non-constant format strings
Replace log.Printf with log.Print for static strings to resolve
go vet warnings about non-constant format strings.

This is a security best practice as using Printf with dynamic strings
can lead to format string vulnerabilities.

Fixed 6 instances in trader/auto_trader.go:
- Line 260: Decision cycle separator (=)
- Line 262: Decision cycle separator (=)
- Line 349: System prompt separator (=)
- Line 353: System prompt separator (=)
- Line 357: CoT trace separator (-)
- Line 361: CoT trace separator (-)
2025-11-03 19:54:47 +08:00
tinkle-community
56e12b5030 Merge pull request #321 from SkywalkerJi/main 2025-11-03 19:53:00 +08:00
SkywalkerJi
33d3a5c3a7 Upgrade this repository's open-source license to AGPL. 2025-11-03 19:50:50 +08:00
ZhouYongyou
1e1f4cc36b fix: define CardProps interface and fix prop name mismatch
- 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'.
2025-11-03 19:45:59 +08:00
ZhouYongyou
563fb0e85d fix: resolve go vet warnings for non-constant format strings
- 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.
2025-11-03 19:40:40 +08:00
ZhouYongyou
366ae87077 style: format Go code with go fmt
- Fix formatting issues flagged by PR advisory checks
- Run go fmt ./... on all Go files
- No functional changes, code style improvements only

Files formatted:
- api/server.go
- auth/auth.go
- decision/engine.go
- logger/decision_logger.go
- manager/trader_manager.go
- market/monitor.go
- market/types.go
- mcp/client.go
- trader/*.go (aster, auto, binance, hyperliquid)
2025-11-03 19:35:41 +08:00
ZhouYongyou
bb2edfc293 feat(market): Add WebSocket stream limit protection with auto-downgrade
## Problem
Binance WebSocket has a hard limit of 1024 streams per connection.
Without protection:
- 300 coins × 4 timeframes = 1200 streams → Connection REJECTED
- System fails to start with "全市場掃描" mode

## Solution
Implement intelligent auto-downgrade mechanism with transparent logging.

### Changes to market/monitor.go (+42 lines)

**1. Add Constants**:
```go
const (
    MaxStreamsPerConnection = 1024  // Binance hard limit
    SafeMaxSymbols = 250            // Safe limit (97.7% usage, 2.3% buffer)
)
```

**2. Add Stream Count Check in Initialize()**:
- Calculate total streams: `len(symbols) × len(subKlineTime)`
- If exceeds 250 coins → Auto-downgrade to first 250
- Display detailed adjustment logs

**3. Add Usage Rate Display**:
```
✓ WebSocket 訂閱: X 個幣種 × 4 時間週期 = Y 流 (Z% 用量)
```

**4. Add High Usage Warning (>90%)**:
```
⚠️ 警告: 訂閱流使用率較高 (93.8%),建議減少幣種數量以確保穩定性
```

## Behavior by Scenario

| Coins | Original Streams | Adjusted Streams | Behavior |
|-------|-----------------|------------------|----------|
| 8 | 32 | 32 |  Normal |
| 100 | 400 | 400 |  Normal |
| 150 | 600 | 600 |  Normal |
| 240 | 960 | 960 | ⚠️ Warning |
| 300 | 1200 | **1000** | 🔄 Auto-downgrade |
| 500 | 2000 | **1000** | 🔄 Auto-downgrade |

## Example Logs

### Normal Case (8 coins):
```
找到 8 个交易对
✓ WebSocket 訂閱: 8 個幣種 × 4 時間週期 = 32 流 (3.1% 用量)
```

### Auto-downgrade Case (300 coins):
```
找到 300 个交易对
⚠️  幣種數量過多,自動調整:
   - 原始數量: 300 個幣種 (1200 流)
   - Binance 限制: 1024 流/連接
   - 時間週期: 4 ([3m 15m 1h 4h])
   - 調整後: 250 個幣種 (1000 流)
   - 已過濾: 前 250 個幣種保留,其餘忽略
✓ WebSocket 訂閱: 250 個幣種 × 4 時間週期 = 1000 流 (97.7% 用量)
⚠️  警告: 訂閱流使用率較高 (97.7%),建議減少幣種數量以確保穩定性
```

## Benefits
-  System always starts successfully (no crashes)
-  Transparent logging (users know what happened)
-  Safe buffer (2.3% headroom for reconnections)
-  No breaking changes (8-250 coins unchanged)
-  Covers all realistic use cases (AI500 + OI Top = ~150 coins)

## Why 250, not 256?
- 256 × 4 = 1024 (no buffer, risky during reconnections)
- 250 × 4 = 1000 (24 stream buffer = 2.3% safety margin)
- Future-proof for potential 5th timeframe

Related: 15m/1h timeframe addition, WebSocket architecture merge
2025-11-03 19:27:01 +08:00
ZhouYongyou
221b03b383 refactor(prompts): enhance partial_close guidance in adaptive & nof1
## Core Changes

### 1. adaptive.txt - Chinese Enhanced Version
- Add comprehensive partial close guidance chapter (line 137-143)
- Update action table with detailed field requirements (line 131)
- Clarify remaining position management strategy (line 273)
- Add compatibility note for close_percentage field (line 276)
- Update base trading constraints to support partial exits (line 69)
- Changes: +13/-4 lines

### 2. nof1.txt - English Enhanced Version
- Add 'PARTIAL CLOSE & DYNAMIC TP/SL GUIDANCE' chapter (line 55-87)
- Enhance partial_close action definition with use cases (line 37-39)
- Update Required field rules (full English translation + enhancements)
- Add example reasoning for multi-stage exit strategy
- Improve all field rules documentation consistency
- Changes: +43/-6 lines

## Benefits
-  Both prompts now have complete partial_close operation guidance
-  Unified standards: clear percentages (25%/50%/75%), remaining position management
-  Language consistency: adaptive (Chinese) / nof1 (English)
-  Practical examples included to guide AI decision-making
-  Detailed instructions for simultaneous TP/SL adjustments

## Backend Compatibility
- All features supported by backend (decision/engine.go)
- No breaking changes
- partial_close, update_stop_loss, update_take_profit all validated

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 19:23:04 +08:00
LindenWang
c330e40531 fix:当前BTC/ETH与主流币杠杆倍数配置不一致并且开仓只有BTC时,大模型会返回其他币种的开仓倍数与当前持仓BTC倍数一致,导致开仓失败 2025-11-03 19:19:05 +08:00
ZhouYongyou
8d12514498 feat(market): Add 15m/1h timeframes for comprehensive trend analysis
## Problem
Merged WebSocket architecture (nofxaios/dev) only supported 3m/4h intervals,
but adaptive.txt v5.5.6.1 requires 15m/1h data for:
- BTC state evaluation (line 105-107)
- Multi-confirmation checklist (line 146, 159)
- False breakout detection (line 176, 182)
- Confidence scoring (line 197)

## Solution
Add 15m and 1h timeframe support across WebSocket pipeline:

### 1. market/monitor.go (+64/-40 lines)
- Add klineDataMap15m and klineDataMap1h to WSMonitor struct
- Update subKlineTime: ["3m", "4h"] → ["3m", "15m", "1h", "4h"]
- Extend initializeHistoricalData() to load 15m/1h historical klines
- Update getKlineDataMap() switch to handle all 4 timeframes
- Fix bug: line 109 used wrong variable (klines vs klines4h)

### 2. market/types.go (+26/-1 lines)
- Add MidTermData15m struct (15-minute short-term trend filtering)
- Add MidTermData1h struct (1-hour mid-term trend confirmation)
- Update Data struct to include:
  - MidTermSeries15m *MidTermData15m
  - MidTermSeries1h *MidTermData1h

### 3. market/data.go (+171/-2 lines)
- Update Get() to fetch klines15m and klines1h via WebSocket
- Implement calculateMidTermSeries15m() - computes EMA20, MACD, RSI7/14 for 15m
- Implement calculateMidTermSeries1h() - computes EMA20, MACD, RSI7/14 for 1h
- Update Format() to output 15m/1h series data for AI prompt context

## Impact Assessment
### WebSocket Load (Binance limit: 1024 streams/connection)
- 8 coins × 4 timeframes = 32 streams (3% usage) 
- 100 coins × 4 timeframes = 400 streams (39% usage) 
- 250 coins × 4 timeframes = 1000 streams (98% usage) ⚠️

### Benefits
- Enables adaptive.txt standard mode: 15m/1h/4h multi-timeframe confirmation
- Restores false breakout detection: 15m RSI vs 1h RSI divergence checks
- Improves confidence scoring: 15m/1h/4h MACD alignment validation
- Zero REST API calls (WebSocket cache, no rate limit risk)

## Testing Notes
- Monitor initial subscription logs for "已加载 X 的历史K线数据-15m/1h"
- Verify AI prompts contain "Mid-term series (15-minute intervals)" section
- Check decision logs reference 15m/1h indicators in reasoning

Related: adaptive.txt v5.5.6.1 requirements, NoFxAiOS/dev WebSocket merge
2025-11-03 19:17:12 +08:00
ZhouYongyou
bead75ef8f merge: Sync with NoFxAiOS/dev - adopt WebSocket architecture
Merged 54 commits from upstream (NoFxAiOS/dev @ 8832557)

## Key Changes

### 🚀 WebSocket Real-time Data Architecture
-  NEW: WebSocket client with auto-reconnect (websocket_client.go)
-  NEW: Market data monitor with combined streams (monitor.go)
-  NEW: K-line caching system (combined_streams.go)
-  UPGRADE: market/data.go now uses WebSocket instead of REST API
- 🎯 Benefits: Lower latency, reduced API limits, auto-reconnect

### 📝 Documentation & CI/CD
-  NEW: Comprehensive troubleshooting guides (EN + ZH-CN)
-  UPGRADE: Enhanced PR workflow with checks
-  NEW: PR title guide & template improvements
-  UPDATE: FAQ expanded with common issues

### 🔧 Conflict Resolution
- market/data.go: Adopted upstream WebSocket version
- prompts/adaptive.txt: Kept our v5.5.6.1 (conf≥85, strict strategy)

### 📊 Stats
- Files changed: 40+
- New files: 12 (WebSocket modules, docs, CI)
- Commits merged: 54

Related: feature/partial-close-dynamic-tpsl
Upstream: NoFxAiOS/nofx @ 8832557
2025-11-03 18:40:54 +08:00
xiehs211
9601d43c41 fix(binance): 同步服务器时间并在 -1021 时自动重试,稳定签名调用 2025-11-03 17:33:43 +08:00
darkedge
cec5100855 Merge branch 'NoFxAiOS:dev' into dev-fix 2025-11-03 17:30:19 +08:00
darkedge
34f61aff50 feat: 使用容器创建初始化所需的config.json和config.db 2025-11-03 17:27:01 +08:00
ZhouYongyou
b3b68b2b62 refactor(prompts): unify action schema & optimize trading discipline
## Core Changes

### 1. adaptive.txt - Adopt v5.5.6.1 strict strategy
- Migrate from dual-strategy system to unified adaptive approach
- Maintain strict confidence threshold ≥85 (anti-overtrading)
- Remove complex market state detection, focus on signal quality
- Explicitly disable partial_close (full exit only)
- -160 lines (removed redundant strategy logic)

### 2. nof1.txt - Fix contradictions & align standards
-  Fix: Remove "NO partial exits" contradiction (now explicitly supported)
-  Unify: Change confidence threshold from 60 → 75
-  Unify: Change risk-reward ratio from 2:1 → 3:1
- Add confidence level guidance (75-85: good, 85-100: high)
- +85 lines (enhanced risk management framework)

### 3. default.txt - Add standardized output format
- Add structured thinking summary format
- Add comprehensive JSON schema documentation
- Add required fields rules for all action types
- +36 lines (improved contract clarity)

## Action Schema Migration

All prompts now use unified action naming:
-  open_long / open_short (was: buy_to_enter / sell_to_enter)
-  close_long / close_short (was: close)
-  update_stop_loss / update_take_profit (new)
-  partial_close (new, nof1 only)
-  hold / wait (unchanged)

## Confidence Scale Migration

-  Changed from 0-1 float to 0-100 integer across all prompts
-  Opening threshold: adaptive=85, nof1=75, default=75
-  Prevents overtrading through strict quality control

## Risk-Reward Standardization

-  Minimum RR ratio: 1:3 across all prompts
-  Replaces previous 1:2 requirement in nof1.txt

## Breaking Changes

- Backend must support new action names
- Confidence field now expects integer 0-100 (not float 0-1)
- partial_close action available in nof1.txt only

## Prompt Positioning

- **adaptive.txt**: Strict strategy (conf≥85, RR≥1:3, no partial exits)
- **nof1.txt**: English framework (conf≥75, RR≥1:3, supports partial_close)
- **default.txt**: Balanced CN strategy (conf≥75, RR≥1:3)

Related: feature/partial-close-dynamic-tpsl
2025-11-03 14:52:31 +08:00
Luna Martinez
88325572e6 Merge pull request #292 from hzb1115/dev
aaafix(workflow): fix github workflow
2025-11-02 22:59:34 -05:00
zbhan
e7e5c7b710 fix comment 2025-11-02 22:55:27 -05:00
zbhan
7a43f25858 Fix validation logic 2025-11-02 22:49:43 -05:00
zbhan
88240019ec Fix validation 2025-11-02 22:24:31 -05:00
zbhan
75115ac747 Fix backend check 2025-11-02 22:15:45 -05:00
zbhan
0500cf7486 Fix validation error 2025-11-02 22:11:24 -05:00
zbhan
7cbef0fd65 fix(workflow): fix github workflow 2025-11-02 21:49:59 -05:00
Luna Martinez
9f2993b67f Change permissions from read to write for contents 2025-11-02 21:15:31 -05:00
Luna Martinez
cbc153f855 Merge pull request #226 from xqliu/docs/enhance-bug-report-template
docs: Enhance bug report template and add troubleshooting guide
2025-11-02 21:08:32 -05:00
tinkle-community
2a61c8aba5 Merge pull request #285 from tangmengqiu/fix/ci-flow 2025-11-03 10:03:56 +08:00
tangmengqiu
9486a0df40 fix(ci): Add comprehensive permissions to pr-checks workflow
Add workflow-level default permissions and explicit per-job permissions
following the principle of least privilege:

Workflow-level (default):
- contents: read - Read repository contents
- pull-requests: write - Manage PR labels and comments
- issues: write - Manage issues (PRs are issues in GitHub API)

Job-level overrides:
- validate-pr: Inherits workflow defaults (needs issue/PR write access)
- backend-tests: Downgrade to read-only (no write operations needed)
- frontend-tests: Downgrade to read-only (no write operations needed)
- auto-label: Add missing issues:write (labeler operates on PR issues)
- security-check: Add security-events:write (upload SARIF results)
- secrets-check: Downgrade to read-only (scanning only)
- all-checks: Downgrade to read-only (status checking only)

This fixes:
1. Potential 403 errors when auto-label tries to add labels to PR issues
2. Missing permission for uploading security scan results
3. Overly permissive access for read-only jobs

Related: #282

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:23:28 -05:00
tinkle-community
afa86b5d80 Merge pull request #266 from 0xEmberZz/quote-tweet-link 2025-11-03 07:01:41 +08:00
tinkle-community
ed4a7a2d20 Merge pull request #268 from yutou123/dev 2025-11-03 06:59:28 +08:00
tinkle-community
45f139a873 Merge pull request #282 from tangmengqiu/fix/dockerfile 2025-11-03 06:50:30 +08:00
tangmengqiu
a7d7ea17cc fix typo 2025-11-02 17:26:47 -05:00