TPTBusiness
0b168fd3e4
feat: Complete P6-P9 implementation (73 tests)
...
P6: ML Feedback Integrator (18 tests)
- MLFeedbackMixin for QuantRDLoop
- Auto-trigger ML training every 500 factors
- Feature importance → prompt feedback
P7: Portfolio Optimizer (28 tests)
- Mean-Variance optimization (max Sharpe)
- Risk Parity (equal risk contribution)
- Correlation analysis (max 0.3)
- Portfolio backtest with weighted signals
P8: Integration Tests (27 tests)
- End-to-end pipeline test
- Parallelization test (4 workers)
- RiskMgmt compliance test
- Error handling test
P9: Documentation
- QWEN.md updated with all new modules
- Project status updated
- Architecture diagram expanded
73 tests passing in 0.48s
2026-04-09 10:09:20 +02:00
TPTBusiness
352dd08514
feat: CLI Commands for strategy generation (P4 complete)
...
New commands:
- rdagent generate_strategies (parallel LLM + Optuna)
- rdagent optimize_portfolio
- rdagent strategies_report
- rdagent fin_quant --auto-strategies
21 integration tests added.
Rich console output with progress bars and tables.
2026-04-09 09:28:24 +02:00
TPTBusiness
6ba2bc0c8f
feat: Strategy Worker module with 41 tests (P1 complete)
...
Created rdagent/scenarios/qlib/local/strategy_worker.py (closed source):
- LLMStrategyGenerator: llama.cpp API calls with retry
- BacktestEngine: isolated subprocess with risk management
- AcceptanceGate: RiskMgmt-compliant validation
- StrategySaver: JSON + metadata persistence
- StrategyWorker: full workflow orchestration
41 tests passing in test/local/test_strategy_worker.py
RiskMgmt rules enforced: SL 2%, max DD 10%, daily loss 5%
2026-04-09 08:28:35 +02:00
TPTBusiness
24a58e970e
docs: Add live trading system documentation to QWEN.md
...
Complete live trading guide for cTrader + RiskMgmt integration:
- Architecture diagram and how it works (5 steps)
- Setup instructions and API configuration
- Usage examples (paper/live trading)
- Risk management and monitoring
- Troubleshooting guide
- Future enhancements roadmap
Documentation kept in QWEN.md only (internal, not public README).
2026-04-07 12:41:07 +02:00
TPTBusiness
360bd26d4f
feat: Strategy performance reports, CLI docs, and README update
...
New files:
- predix_strategy_report.py: Performance report generator with charts
* Dashboard (equity, drawdown, signals, monthly returns, metrics)
* Individual PNG charts per strategy
* Text report with full metrics
* Auto-generated after each accepted strategy
- debug_backtest.py: Debug script for backtest alignment & IC check
Updated:
- predix_gen_strategies_real_bt.py: Auto-generate report per strategy
- README.md: Full CLI commands reference (all predix commands)
- QWEN.md: Architecture update, CLI commands, env variables
Key fixes already committed:
- 96-bar forward returns (matching factor IC horizon)
- LogColors disabled when not TTY (NO_COLOR support)
- litellm 'Provider List' as info, not warning
- QuantTrace controller initialization fix
- LogColors TTY detection
2026-04-07 09:12:04 +02:00
TPTBusiness
a8c23bd130
feat: Add AI Strategy Builder (StrategyCoSTEER) - Closed Source
...
Open Source Changes:
- Add prompt loader functions for strategy prompts
- Add factor values persistence (parquet) in factor_runner.py
- Add CLI command: predix build-strategies-ai
- Integrate strategy building into QuantRDLoop (every 50 factors)
- Add StrategyBuilder design documentation
Closed Source Files (NOT committed, in local/):
- strategy_coster.py - Main CoSTEER loop for strategies
- strategy_evaluator.py - Walk-forward backtesting
- strategy_runner.py - Strategy execution
- strategy_discovery_v1.yaml - LLM prompts
Usage:
predix build-strategies-ai # Build from top 50 factors
predix build-strategies-ai -t 100 # Use top 100 factors
predix build-strategies-ai -l 10 # 10 improvement loops
The system:
1. Loads top factors with time-series values
2. LLM generates strategy hypotheses
3. LLM writes strategy code (entry/exit rules)
4. Backtests strategy with walk-forward validation
5. LLM gets feedback and improves
6. Repeats until profitable strategy found
2026-04-05 19:30:12 +02:00
TPTBusiness
9285a5f97a
docs: Update QWEN.md with complete 5-phase architecture and results
...
Added:
- Complete 5-phase pipeline architecture diagram
- Factor evaluation results (1009 factors, 337 successful)
- Top 10 factors by IC table
- Failure analysis (672 failed, 80% code crashes)
- Optimization potential (7 areas for high-end upgrades)
Sections added:
- Phase 1: Factor Generation (Open Source)
- Phase 2: ML Training (Closed Source)
- Phase 3: Portfolio Optimization (Closed Source)
- Phase 4: Strategy Generation (Closed Source)
- Phase 5: Iterative Improvement (Closed Source)
High-end optimization suggestions:
1. Code quality (33% → 70%+ success rate)
2. ML pipeline (SHAP, ensemble, Optuna)
3. Portfolio optimization (risk parity, Black-Litterman)
4. Strategy generation (regime-specific, multi-timeframe)
5. Execution optimization (parallel, smart retry)
6. Risk management (VaR/ES, correlation monitoring)
7. Infrastructure (GPU, caching, monitoring)
2026-04-04 23:17:36 +02:00
TPTBusiness
5ce86c824e
feat: Full system integration - RL + Protections + Backtesting + CLI
...
Connect all Predix components into unified trading system:
INTEGRATION (ALL 295 TESTS PASS):
- RL Trading connected with Protection Manager
- RL Trading connected with Backtesting Engine
- CLI command 'rdagent rl_trading' added (train/backtest/live modes)
- Graceful fallback for users without stable-baselines3
OPEN SOURCE COMPATIBILITY:
- System works WITHOUT stable-baselines3 (momentum fallback)
- System works WITHOUT local models/prompts (uses standard)
- Clear warning messages when optional deps missing
- GitHub users get FULLY WORKING system
CLOSED SOURCE PROTECTION:
- models/local/, prompts/local/, .env stay local only
- .gitignore properly configured
- Our alpha (best models/prompts) remains private
DOCUMENTATION:
- QWEN.md: Open/closed source strategy
- QWEN.md: Development guidelines for AI assistant
- QWEN.md: Open source compatibility principle
- README.md: RL Trading CLI commands and examples
- requirements/rl.txt: Optional RL dependencies
Modified files:
- rdagent/app/cli.py: Added rl_trading command
- rdagent/components/backtesting/backtest_engine.py: RL backtest support
- rdagent/components/coder/rl/costeer.py: Protection Manager integration
- rdagent/components/coder/rl/__init__.py: Conditional imports + fallback
- rdagent/components/coder/rl/fallback.py: NEW - Simple momentum fallback
- requirements.txt: Optional RL deps commented
- requirements/rl.txt: NEW - Full RL dependencies
- test/integration/test_all_features.py: 7 new integration tests
- QWEN.md: Open source strategy + development guidelines
- README.md: RL Trading documentation
295 tests pass: 67 integration + 89 RL + 139 backtesting
2026-04-03 13:53:32 +02:00
TPTBusiness
1bbca062af
feat: Add RL Trading Agent system with 99 tests
...
Implement Reinforcement Learning trading system inspired by FinRL concepts
(100% original code, NOT copied from FinRL MIT project):
RL ENVIRONMENT:
- TradingEnv: Gymnasium-compatible environment
- State: price history + indicators + portfolio state
- Action: continuous position [-1, 1] (short to long)
- Reward: return - transaction costs - drawdown penalty
RL AGENT:
- RLTradingAgent: Wrapper for Stable Baselines3
- Supports PPO (stable), A2C (fast), SAC (continuous)
- Methods: create_model(), train(), predict(), save(), load(), evaluate()
COSTEER (fills TODO at costeer.py:112):
- RLCosteer: RL-based trading controller
- Risk-limit enforcement (15% drawdown stops trading)
- Position scaling based on risk appetite
- Trade history tracking
TECHNICAL INDICATORS:
- RSI, MACD, Bollinger Bands, CCI, ATR
- prepare_features() helper for easy integration
TESTS (99 total, ALL PASS):
- 26 env tests
- 16 agent tests
- 19 costeer tests
- 18 indicator tests
- 10 integration tests
Documentation:
- Update QWEN.md with RL system architecture
2026-04-03 13:26:10 +02:00
TPTBusiness
bd025e50dc
feat: Add Trading Protection System with 4 protections + comprehensive tests
...
Implement automatic trading protection system to prevent excessive losses:
PROTECTIONS (100% original code, NOT copied from Freqtrade):
- Max Drawdown Protection: Blocks trading when DD > 15% (configurable)
- Cooldown Period: 4h mandatory rest after 5% loss
- Stoploss Guard: Detects stoploss clusters (>5 per day)
- Low Performance Filter: Filters factors with Sharpe < 0.5, Win Rate < 40%
ARCHITECTURE:
- Base protection interface with common utilities
- 4 specialized protection implementations
- ProtectionManager orchestrates all active protections
- Time-based blocking with automatic expiry
TESTS (32 total, ALL PASS):
- 25 unit tests in test/backtesting/test_protections.py
- 7 integration tests in test/integration/test_all_features.py
- Tests cover: normal operation, edge cases, error handling
DOCUMENTATION:
- Update QWEN.md with development guidelines for AI assistant
* Mandatory rules: Update QWEN.md, README, requirements.txt, tests
* Pre-commit checklist
* Example workflow
- Update README.md with protection system features
- Update project structure with new modules
All code is 100% original - NO license issues with Freqtrade GPLv3.
2026-04-03 13:01:56 +02:00
TPTBusiness
2a011d262e
chore: Simplify pre-commit to mandatory hooks only
...
- Remove optional code quality hooks (black, isort, ruff, mypy, toml-sort)
* These blocked commits when tools not installed
* Users can run them manually when needed
- Keep only MANDATORY hooks:
* Integration Tests (60 tests, ~7.5s)
* Bandit Security Scan
- Both MUST pass before every commit
2026-04-03 12:33:30 +02:00
TPTBusiness
a3ad4973a2
docs: Update QWEN.md with implementation guide
...
Added comprehensive implementation guide:
- How to use Prompt Loader (auto-loads local prompts)
- How to use Model Loader (auto-loads local models)
- Creating improved prompts (step-by-step)
- Creating improved models (step-by-step)
- Backup private assets to private repo
- Security best practices
- Open Source vs. Closed Source overview
Updated architecture section:
- Added prompts/ and models/ directory structure
- Documented loader.py and model_loader.py
- Clarified what's open vs. closed source
2026-04-02 23:12:08 +02:00
TPTBusiness
30ee6c6221
chore: Remove unnecessary files for v1.0.0 release
...
Removed:
- Makefile (RD-Agent specific, not fully functional)
- predix.py (duplicates rdagent CLI)
- QWEN.md (internal dev guide - now in .gitignore)
- TODO.md (internal tracking - now in .gitignore)
Kept:
- pyproject.toml (required for pip install)
- start_loop.sh (useful for 24/7 trading)
- data_config.yaml (central configuration)
- start_loop.sh (24/7 trading)
.gitignore updated to exclude internal docs.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com >
2026-04-02 21:12:58 +02:00
TPTBusiness
bb450f7740
docs: Translate all code comments to English
...
- Updated QWEN.md with English-only comment policy
- Translated all German comments in:
* eurusd_regime.py
* eurusd_llm.py
* eurusd_reflection.py
* eurusd_memory.py
* eurusd_macro.py
* eurusd_debate.py
* predix_dashboard.py
- All comments, docstrings, and print statements now in English
- Ensures consistency with commit messages and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com >
2026-04-02 20:21:59 +02:00
TPTBusiness
9315fa8b5e
docs: Update QWEN.md with detailed Git history correction guide
...
- Added step-by-step rebase instructions
- Listed all German commits that need translation
- Provided English translations for each
- Added force push warnings and team coordination notes
2026-04-02 19:25:05 +02:00
TPTBusiness
2d82325504
docs: Add comprehensive Git commit guidelines to QWEN.md
...
- English-only commit messages policy
- Pre-commit checklist (git status, diff, tests)
- Conventional Commits format
- Protected files list (.qwen/, results/, *.db, .env)
- Instructions for fixing past commits
- Push policy and enforcement
2026-04-02 19:25:05 +02:00