crypto_predictor
6184c34a3a
fix: 更新 generate_market_slug 格式,新增年份字段
2026-03-15 14:21:49 +08:00
crypto_predictor
80f2a82c19
feat: unify proxy config and centralize runtime logging
2026-03-07 14:45:34 +08:00
crypto_predictor
7af21bed6a
feat: 添加每日数据报告定时推送功能
...
- 新增 daily_report_sender.py 定时任务程序
- 北京时间每天 8 点推送昨天 24 小时预测统计
- 包含各模型准确率、逐小时预测详情
- 失败交易订单汇总
- start_system.py 集成启动报告推送服务
2026-02-28 10:55:34 +08:00
crypto_predictor
e7e01516ba
chore: staged changes
2026-02-27 13:36:37 +08:00
subuhui
1d732844e3
retry
2026-02-24 17:42:00 +08:00
crypto_predictor
7d5c8c57b7
ensemble file
2026-02-22 19:46:21 +08:00
crypto_predictor
f13b1c1afe
update polymarket trading: fix auth, add order monitoring, optimize status handling, remove unused scripts
2026-02-12 21:47:09 +08:00
crypto_predictor
7004b281a4
refactor: Migrate inference service to use ONNX Runtime
2026-02-12 12:43:58 +08:00
crypto_predictor
e773775acd
feat: Update ONNX export script and add TTM-R2 ONNX model
2026-02-12 12:02:46 +08:00
crypto_predictor
8138629e06
Merge branch 'feature/code_optimization'
2026-02-12 10:10:29 +08:00
crypto_predictor
fe986256c0
feat: Export N-BEATS and TTM-R2 models to ONNX format
2026-02-12 10:02:26 +08:00
crypto_predictor
6a882ed913
fix: update initial trade logic
...
- Enable immediate trading attempt on startup
- Dynamic timeout calculation (remaining minutes - 10) for initial trade
- Added duplicate check for initial prediction saving to prevent DB errors
2026-02-11 23:36:07 +08:00
crypto_predictor
99fa79cde4
fix: timezone handling and prediction logic
...
- api/models.py: Fix timezone conversion in stats queries by calculating UTC ranges in Python instead of using SQL CONVERT_TZ. Ensure JSON serializable types.
- api/prediction_service.py:
- Update ensure_predictions_for_month to check previous day (ET) to cover CST month start.
- Update _generate_prediction_for_hour to skip saving unclosed candles (current hour).
- trader/auto_trade_polymarket.py: Update to use hourly_model_predictions (V2) table for storing live trading predictions.
2026-02-11 23:14:50 +08:00
crypto_predictor
2993014fa8
feat: upgrade to multi-model ensemble system
...
- Updated DB schemas: added 'strategy' to trades, new 'hourly_model_predictions' wide table
- Refactored backend: api/models.py, api/prediction_service.py to support wide format
- Updated trader: auto_trade_polymarket.py now logs strategy and saves to new table
- Updated frontend: index.html and app.js to display multi-model accuracy and trade strategy
2026-02-11 22:13:35 +08:00
crypto_predictor
c0a02868ac
feat: refactor model inference architecture
...
- Unified inference logic into models/inference.py
- Added InferenceManager for handling DLinear, N-BEATS, and TTM-R2 models
- Updated prediction_service.py and auto_trade_polymarket.py to use the new manager
- Fixed dependency issues (torch, transformers)
- Resolved logger duplication issue
- Verified with test_models_feb_2026.py
2026-02-11 22:07:32 +08:00
crypto_predictor
d34b67f522
Add CLAUDE.md guide and preprocessing comparison script
2026-02-10 23:26:44 +08:00
crypto_predictor and Claude Opus 4.6
84288a687a
feat: auto_trade 每小时预测结果写入预测表并回填上一小时实际结果
...
- 导入 PredictionModel,预测完成后保存到 model_predictions 表
- 当前小时预测 actual_result/is_correct/close_price 留空(未收盘)
- 新增 _update_previous_prediction:每次整点回填上一小时实际涨跌(收盘价 vs 开盘价)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-10 23:19:57 +08:00
crypto_predictor and Claude Opus 4.6
e78836bf42
fix: 修复 auto_trade 推理预处理逻辑,新增 create_labels 版对比测试脚本
...
auto_trade_polymarket.py: 新增 preprocess_for_inference 方法,推理时不调用
create_labels(避免 df[:-1] 砍掉输入K线),与 test 脚本逻辑一致。
test_dlinear_jan_2026_create_labels.py: 使用 create_labels 方式的 DLinear 测试
脚本,用于对比两种预处理方式的准确率差异。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-10 23:05:17 +08:00
crypto_predictor
7990312878
feat: 添加 ONNX 导出功能及 DLinear 模型导出
2026-02-08 15:05:09 +08:00
crypto_predictor
5ca1779d7d
fix: 精简 requirements.txt,移除未使用的依赖
...
移除的依赖:
- gluonts: 项目中未使用
- pytorch-lightning: 非必需
- torchmetrics: 非必需
- onnx/onnxruntime: 非核心功能
- sqlalchemy: 使用 pymysql 直连
- jupyter/matplotlib/seaborn/pytest: 开发工具,非运行必需
保留的核心依赖:
- pandas, numpy, scikit-learn: 数据处理
- granite-tsfm: TTM-R2 模型
- pandas-ta: 技术指标
- fastapi, uvicorn: API 服务
- httpx, python-binance: 数据获取
- schedule: 任务调度
- pymysql, cryptography: 数据库
注意:PyTorch 需要单独安装(Windows 用 CPU 版本)
2026-02-07 22:28:46 +08:00
crypto_predictor
9320b79730
refactor: 重新整理 requirements.txt
...
主要更改:
- 修正 TTM 模型包名: tsfm_public -> granite-tsfm
- 添加缺失依赖: httpx, schedule, pytorch-lightning, torchmetrics
- 移除过时依赖: darts, u8darts
- 按功能分类组织依赖
- 添加 Windows/macOS 安装说明注释
- 更新安装脚本和文档中的包名
2026-02-07 22:26:07 +08:00
crypto_predictor
06800ddb43
fix: 修正 tsfm-public 包名,添加一键安装脚本
...
- 添加 install_windows.bat 一键安装脚本
- 修正文档中 tsfm_public -> tsfm-public (PyPI 包名用连字符)
- 添加 GitHub 备用安装方式
2026-02-07 22:02:56 +08:00
crypto_predictor
340c11d4ab
docs: 添加 Windows 环境安装指南
...
包含完整的安装流程:
- Miniconda 安装
- Conda 环境创建
- PyTorch CPU 版本安装
- 项目依赖安装
- 数据库配置
- 环境变量配置
- 运行和验证步骤
- 常见问题解答
2026-02-07 21:55:56 +08:00
crypto_predictor
d0696a42ba
feat: 添加 Windows 启动脚本
...
- start_system.bat: CMD 批处理脚本,双击即可运行
- start_system.ps1: PowerShell 脚本,支持进程监控和优雅退出
两个脚本都会:
1. 激活 crypto_pred_312 conda 环境
2. 启动 API 服务 (端口 8000)
3. 启动自动交易程序
2026-02-07 21:54:46 +08:00
crypto_predictor
233f0c5d10
feat: 添加 Windows 兼容性支持,优化设备选择逻辑
...
- start_system.py: 跨平台进程管理
- Windows 使用 CREATE_NEW_PROCESS_GROUP 和 terminate()
- Unix 使用 setsid 和 killpg
- 自动检测并启用 Windows ANSI 颜色支持
- 设备选择逻辑优化:
- macOS: 优先使用 MPS,回退到 CPU
- Windows/Linux: 强制使用 CPU(无 CUDA 依赖)
- 影响文件:
- api/prediction_service.py
- auto_trade_polymarket.py
- training/config.py
2026-02-07 21:48:06 +08:00
crypto_predictor
8cdfb2a8e2
fix: 统一时区处理,准确率统计使用CST时间分组
...
- 增强 convert_to_cst() 函数,新增 source_tz 参数支持 UTC/ET/CST 输入
- 修改 get_monthly_stats() 使用 CONVERT_TZ 按 CST 月份统计
- 修改 get_daily_stats() 使用 CONVERT_TZ 按 CST 日期分组
- 修改 get_hourly_details() 按 CST 日期筛选和小时排序
- 交易记录使用 source_tz='CST' 避免重复转换
- 前端表头添加'(北京)'时区标注
2026-02-07 18:14:37 +08:00
crypto_predictor
6182630203
docs: 更新 AGENTS.md 开发指南,反映最新的架构变更
2026-02-07 16:58:44 +08:00
crypto_predictor
a12e035c1c
feat: 添加系统启动脚本 start_system.py
2026-02-07 16:50:58 +08:00
crypto_predictor
55453d3739
feat(frontend): 添加交易看板,统一时区为CST
...
refactor(db): 移除所有SQLite相关代码,迁移至MySQL
2026-02-07 16:48:14 +08:00
crypto_predictor
5e0d6b18ef
chore: Secure secrets and add MySQL deps
2026-02-06 17:24:33 +08:00
crypto_predictor
8de6c54887
feat: Add MySQL support and migration script
2026-02-06 16:35:08 +08:00
crypto_predictor
006ccb2a1d
chore: Remove environment.yml
2026-02-06 16:28:54 +08:00
crypto_predictor
4bd5cb44e4
data: Add market_data.db
2026-02-06 15:50:34 +08:00
crypto_predictor
bd722242ad
docs: Add AGENTS.md and initial trading database
2026-02-06 15:49:43 +08:00
crypto_predictor
db937fdcf9
feat: Add DB logging, price monitoring, and duplicate trade prevention
2026-02-06 15:48:45 +08:00
crypto_predictor
fcf64f4a3d
添加数据库文件
2026-02-04 18:38:09 +08:00
crypto_predictor
59fcb11ffa
接入数据库
2026-02-04 18:35:10 +08:00
crypto_predictor
1bd9d25f60
refactor: 清理测试文件和2019相关代码
...
- 删除测试脚本: test_2026_classification.py, test_lagllama.py, test_timesfm.py, test_ttm.py
- 删除2019相关文件: analyze_2019_*, apply_2019_*, dlinear_2019_*, three_models_2019_*
- 添加集成模型相关代码和分析脚本
- 添加N-BEATS模型和CatBoost分类模型
2026-02-03 20:40:32 +08:00
crypto_predictor and Claude Sonnet 4.5
c74f4f6949
Clean up: keep only best model (53.10% accuracy)
...
🧹 清理内容:
- 删除所有实验模型(保留 dlinear_classification_2026)
- 删除所有测试和分析脚本
- 删除所有实验训练脚本
✅ 保留文件:
- models/checkpoints/dlinear_classification_2026/ (最佳模型)
- train_classification_full.py (训练脚本)
- test_2026_classification.py (测试脚本)
- data/, models/, training/ (核心代码)
- README.md, requirements.txt
📦 删除文件统计:
- 9个实验模型目录
- 21个测试/分析/实验脚本
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-29 21:58:23 +08:00
crypto_predictor and Claude Sonnet 4.5
9bbdc8d42b
Initial commit: BTC 1h prediction model (53.10% accuracy)
...
🎯 项目成果:
- 准确率: 53.10% (2026年测试集)
- 任务类型: 二分类 (预测涨/跌)
- 特征: OHLCV + RSI + MACD (9个特征)
- 训练数据: 2020-2025年BTC小时数据 (52,351序列)
- 测试数据: 2026年1-29日 (484序列)
📊 性能指标:
- 精确率: 51.79%
- 召回率: 49.36%
- F1分数: 0.5054
- 预测分布: 非常平衡 (偏差仅-11个)
🔬 实验历史:
- 尝试了5种方案 (回归/分类, 不同数据划分)
- 分类任务优于回归任务 (53.10% vs 49.5%)
- 全量训练避免了过拟合问题
📦 主要模型文件:
- models/checkpoints/dlinear_classification_2026/
- best_model.pt (最佳模型)
- preprocessor.pkl (预处理器)
- test_2026_results.json (测试结果)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-29 21:27:15 +08:00