Skip to content

Conversation

@NoFearInMyHeart-G
Copy link
Contributor

增加持仓最高收益缓存和自动止盈机制

功能描述

本次PR新增了两个核心功能来优化交易系统的风险管理:

1. 单币持仓最高收益缓存

  • 为每个持仓币种维护最高收益缓存
  • 实时跟踪和更新持仓的历史最高收益
  • 为回撤计算提供数据基础

2. 定时止盈检查任务

  • 新增每分钟执行的定时任务
  • 监控所有持仓的收益回撤情况
  • 自动止盈条件:
    • 最高收益回撤 >= 40%
    • 当前利润 >= 5%

- 添加单币持仓最高收益缓存功能
- 实现定时任务,每分钟检查持仓收益情况
- 添加止盈条件:最高收益回撤>=40且利润>=5时自动止盈
- 优化持仓监控和风险管理能力
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

🤖 Advisory Check Results

These are advisory checks to help improve code quality. They won't block your PR from being merged.

📋 PR Information

Title Format: ✅ Good - Follows Conventional Commits
PR Size: 🟢 Small (180 lines: +175 -5)

🔧 Backend Checks

Go Formatting: ⚠️ Needs formatting

Files needing formatting
api/server.go
config/database.go
manager/trader_manager.go
trader/auto_trader.go

Go Vet: ✅ Good
Tests: ✅ Passed

Fix locally:

go fmt ./...      # Format code
go vet ./...      # Check for issues
go test ./...     # Run tests

⚛️ Frontend Checks

Build & Type Check: ✅ Success

Fix locally:

cd web
npm run build  # Test build (includes type checking)

📖 Resources

Questions? 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.

@Icyoung Icyoung merged commit 5cdd0ab into NoFxAiOS:dev Nov 5, 2025
ForeverInLaw pushed a commit to ForeverInLaw/nofx that referenced this pull request Nov 8, 2025
feat: 增加持仓最高收益缓存和自动止盈机制
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants