mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 12:07:43 +00:00
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
This commit is contained in:
@@ -1 +1,34 @@
|
||||
from rdagent.components.coder.rl.costeer import RLCoSTEER
|
||||
"""RL Trading Agent components for Predix.
|
||||
|
||||
This package provides:
|
||||
- RLCoSTEER: LLM-based code generation for RL training pipelines
|
||||
- RLCosteer: RL-based trading controller using trained models
|
||||
- TradingEnv: Gym-compatible trading environment
|
||||
- RLTradingAgent: Stable Baselines3 wrapper for PPO, A2C, SAC
|
||||
- Technical indicators: RSI, MACD, Bollinger Bands, CCI, ATR
|
||||
"""
|
||||
|
||||
from rdagent.components.coder.rl.agent import RLTradingAgent
|
||||
from rdagent.components.coder.rl.costeer import RLCoSTEER, RLCosteer
|
||||
from rdagent.components.coder.rl.env import TradingEnv
|
||||
from rdagent.components.coder.rl.indicators import (
|
||||
calculate_atr,
|
||||
calculate_bollinger_bands,
|
||||
calculate_cci,
|
||||
calculate_macd,
|
||||
calculate_rsi,
|
||||
prepare_features,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"RLCoSTEER",
|
||||
"RLCosteer",
|
||||
"RLTradingAgent",
|
||||
"TradingEnv",
|
||||
"calculate_atr",
|
||||
"calculate_bollinger_bands",
|
||||
"calculate_cci",
|
||||
"calculate_macd",
|
||||
"calculate_rsi",
|
||||
"prepare_features",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user