Liu Xiang Qian
c1f080f59f
feat: 添加前端对 SystemPromptTemplate 更新的完整支持
...
## 修改内容
### 后端 (api/server.go)
- handleGetTraderConfig 返回中添加 system_prompt_template 字段
### 前端类型定义 (web/src/types.ts)
- TraderConfigData 接口添加 system_prompt_template 字段
### 前端更新逻辑 (web/src/components/AITradersPage.tsx)
- handleSaveEditTrader 的更新请求中添加 system_prompt_template
## 完整数据流
```
后端数据库
↓ handleGetTraderConfig
前端 TraderConfigData (包含 system_prompt_template)
↓ TraderConfigModal (UI 编辑)
前端 UpdateRequest (包含 system_prompt_template)
↓ handleUpdateTrader
后端更新数据库
```
现在前后端已完全打通,用户可以在 UI 中编辑系统提示词模板了。
2025-11-03 22:19:58 +08:00
Liu Xiang Qian
b0de71bdf5
feat: 支持更新 Trader 的系统提示词模板
...
允许在编辑 Trader 时更新系统提示词模板(SystemPromptTemplate)。
系统提示词模板用于控制 AI 交易决策的行为模式。目前创建 Trader 时可以指定模板,但编辑时无法修改。
1. **UpdateTraderRequest** 添加 `SystemPromptTemplate` 字段
```go
SystemPromptTemplate string `json:"system_prompt_template"`
```
2. **handleUpdateTrader** 添加处理逻辑
- 如果请求中提供新模板,使用新值
- 如果为空字符串,保持数据库中的原有值
```go
systemPromptTemplate := req.SystemPromptTemplate
if systemPromptTemplate == "" {
systemPromptTemplate = existingTrader.SystemPromptTemplate
}
```
3. **TraderRecord** 设置 SystemPromptTemplate 字段
```go
SystemPromptTemplate: systemPromptTemplate,
```
- ✅ 支持在编辑 Trader 时更新系统提示词模板
- ✅ 空值时保持原有值不变(向后兼容)
- ✅ 与创建 Trader 时的行为保持一致
- ✅ 无破坏性变更
1. 用户创建 Trader 时使用了默认模板
2. 后续想切换到自定义模板(如更激进或保守的策略)
3. 通过编辑功能修改 SystemPromptTemplate 字段
4. 保存后,AI 将使用新的提示词模板进行决策
1. 创建 Trader(使用默认模板 "default")
2. 编辑 Trader,修改 system_prompt_template 为 "aggressive"
3. 保存并验证修改成功
4. 再次编辑,不修改 system_prompt_template(传空字符串)
5. 验证保持 "aggressive" 不变
2025-11-03 22:15:23 +08:00
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
Liu Xiang Qian
8ad85a4a5b
revert: 移除 SystemPromptTemplate 相关修改
...
将 SystemPromptTemplate 功能从扫描间隔 PR 中分离出来,
保持 PR 单一职责。
SystemPromptTemplate 功能将在单独的 PR 中处理。
2025-11-03 22:02:25 +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
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
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
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
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
tangmengqiu
85d48f316b
fix(docker): Fix go-sqlite3 compilation on Alpine Linux
...
Add CGO_CFLAGS="-D_LARGEFILE64_SOURCE" to resolve musl libc compatibility
issues. This enables the Large File Support feature macros which map
pread64/pwrite64/off64_t symbols (used by SQLite) to musl's native
pread/pwrite/off_t implementations.
This fix eliminates the "undeclared identifier" errors during CGO
compilation without requiring additional sqlite-dev dependencies.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-02 17:15:01 -05:00
tinkle
8ad737e3a3
docs: Replace sensitive configuration examples with placeholders
...
Update documentation to use placeholder values instead of real credentials
in example configurations for enhanced security.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-03 03:47:41 +08:00
tinkle-community
13e1da6cf6
Merge pull request #275 from zhouyongyou/docs/adaptive-prompt-template
...
docs(prompts): 更新 AI prompt 支持動態 TP/SL 功能 (Update AI prompt to support dynamic TP/SL features)
2025-11-03 02:05:48 +08:00
ZhouYongyou
bad79337fb
docs(prompts): Update AI prompt to support dynamic TP/SL features (v5.5.1)
...
- Add 3 new action types: update_stop_loss, update_take_profit, partial_close
- Introduce "Zero Principle" (疑惑优先) for risk control
- Expand decision flow to 8 steps with critical safeguards:
* Step 2: Consecutive loss pause (2x→45min, 3x→24h, 4x→72h)
* Step 5: BTC status check (multi-timeframe MACD confirmation)
* Step 6: Long/short confirmation checklist (≥5/8 indicators)
* Step 7: Fake breakout detection (RSI multi-timeframe + candle patterns)
* Step 8: Objective confidence scoring (base 60 + conditions)
- Add signal priority ranking (trend resonance > volume > BTC > RSI...)
- Add dynamic TP/SL strategies with examples
- Increase confidence threshold: 0.6 → 0.85 for opening positions
- Add cooldown rules and slippage buffer (0.05%)
- Optimize prompt length: 4445 words → 1500 words (-66%)
Key improvements in v5.5.1:
✅ BTC status check - Most critical protection for altcoin trading
✅ Long/short checklist - 5/8 indicators required, prevent false signals
✅ Objective confidence scoring - Base 60 + condition adjustments
✅ Fake breakout logic - RSI multi-timeframe + candle filters
✅ Consecutive loss pause - 2x/3x/4x trigger different cooldowns
✅ OI confirmation - >+5% for real breakout validation
✅ Signal priority ranking - Trend resonance > volume > BTC...
✅ Slippage handling - 0.05% buffer + profit check
Design philosophy: Let AI autonomously judge trend vs chop, trust strong reasoning models.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-03 01:59:54 +08:00
芋头
2bb28a1738
文件命名空格问题
2025-11-03 00:16:28 +08:00
Ember
f3cc95d267
Merge branch 'dev' into quote-tweet-link
2025-11-02 23:56:46 +08:00
芋头
0f25e56b13
补充提示词
2025-11-02 23:56:32 +08:00
Ember
a7a0bdff41
chore(landing): add lightweight AnimatedSection wrapper for main-based branch
2025-11-02 23:52:15 +08:00
Ember
97015d31a2
chore(landing): add lightweight AnimatedSection wrapper for main-based branch
2025-11-02 23:49:23 +08:00
Ember
0b86916d8c
feat(landing): integrate real community tweets in CommunitySection with author avatars and links
2025-11-02 23:48:25 +08:00
Roninchen
b336efde0f
Merge pull request #176 from yuanshi2016/dev
...
Kline获取方式为Websocket缓存
2025-11-02 21:54:16 +08:00
tinkle-community
37c98c9626
Merge pull request #257 from SkywalkerJi/dev
...
Google Tag Manager
2025-11-02 21:47:38 +08:00
SkywalkerJi
4850aa568e
Google Tag Manager
2025-11-02 21:44:53 +08:00
tinkle-community
e9f6ded053
Merge pull request #246 from xqliu/fix/model-config-validation-245
2025-11-02 18:32:45 +08:00
Liu Xiang Qian
4577adabbd
fix: Update model validation in handleSaveModelConfig to support both configured and supported models
...
- Change validation to check allModels first, then supportedModels
- This allows saving new model configurations without "model does not exist" error
- Fixes issue where users couldn't save AI model config after selecting from dropdown
Fixes #245
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-02 18:08:25 +08:00
yuanshi2016
95c32fcb2e
修改Kline获取方式为Websocket缓存。
2025-11-02 17:59:19 +08:00
yuanshi2016
3b1db6f64f
K线获取方式改为websocket组合流. 带重拨机制
...
流程为下:
1. 启动时使用所有交易员设置的币种(去重) 如果交易员未配置,则使用系统默认
2. 在决策获取K线时 如果没有缓存 则先实时获取后再添加订阅. ps: 适用于Api方式的币种列表
2025-11-02 14:03:13 +08:00
原始
1862223528
Merge branch 'tinkle-community:dev' into dev
2025-11-02 14:02:11 +08:00
tinkle
4f8be19a73
update aster exchange guide
2025-11-02 12:23:33 +08:00
原始
ebfdf4b9b6
Merge branch 'tinkle-community:dev' into dev
2025-11-02 12:19:40 +08:00
tinkle
23392e7409
update aster exchange guide
2025-11-02 12:15:40 +08:00
Liu Xiang Qian
8b4c107dfd
docs: Enhance timestamp/timezone troubleshooting based on Issue #60
...
Enhanced the Exchange API errors section with more detailed solutions
for timestamp-related failures, based on Issue #60 .
Problem:
- code=-1021: Timestamp outside of recvWindow
- System time not synced with Binance servers
- Docker container time drift
Enhanced Solutions:
1. System Time Sync (Multiple methods)
- ntpdate pool.ntp.org (recommended)
- ntpdate with different NTP servers
- timedatectl for automatic sync
- Aliyun NTP for China users
2. Docker-specific fixes
- Check container time vs host time
- Restart Docker service
- Add TZ environment variable
3. API Key verification steps
- Regeneration procedure
- Permission checklist
4. Rate limit considerations
- Reduce trader count
- Increase decision interval
Both English and Chinese versions updated.
Fixes : #60
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-02 11:44:57 +08:00
Liu Xiang Qian
1271e278f2
docs: Add Docker image pull failure troubleshooting (China)
...
Added comprehensive troubleshooting guide for Docker image pull failures
in mainland China, based on Issue #168 .
Problem:
- Users in China cannot pull Docker images from Docker Hub
- ERROR: load metadata for docker.io/library/...
- Timeouts and connection failures
Solutions Added:
1. Configure Docker registry mirrors (Recommended)
- List of working China mirrors
- Step-by-step configuration for Linux/macOS/Windows
- Verification commands
2. Use VPN
- Taiwan nodes recommended
- Global mode required
3. Offline image download
- Image proxy websites
- Manual import instructions
Both English and Chinese versions updated.
Fixes : #168
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-02 11:38:53 +08:00