williams data structure in data provider

This commit is contained in:
Dobromir Popov
2025-05-31 00:26:05 +03:00
parent 0331bbfa7c
commit 7a0e468c3e
4 changed files with 960 additions and 76 deletions

View File

@ -31,7 +31,7 @@ from .extrema_trainer import ExtremaTrainer
from .trading_action import TradingAction
from .negative_case_trainer import NegativeCaseTrainer
from .trading_executor import TradingExecutor
from training.enhanced_pivot_rl_trainer import EnhancedPivotRLTrainer, create_enhanced_pivot_trainer
# Enhanced pivot RL trainer functionality integrated into orchestrator
logger = logging.getLogger(__name__)
@ -158,19 +158,12 @@ class EnhancedTradingOrchestrator:
self.current_positions = {} # symbol -> {'side': 'LONG'|'SHORT'|'FLAT', 'entry_price': float, 'timestamp': datetime}
self.last_signals = {} # symbol -> {'action': 'BUY'|'SELL', 'timestamp': datetime, 'confidence': float}
# Initialize Enhanced Pivot RL Trainer
self.pivot_rl_trainer = create_enhanced_pivot_trainer(
data_provider=self.data_provider,
orchestrator=self
)
# Pivot-based dynamic thresholds (simplified without external trainer)
self.entry_threshold = 0.7 # Higher threshold for entries
self.exit_threshold = 0.3 # Lower threshold for exits
self.uninvested_threshold = 0.4 # Stay out threshold
# Get dynamic thresholds from pivot trainer
thresholds = self.pivot_rl_trainer.get_current_thresholds()
self.entry_threshold = thresholds['entry_threshold'] # Higher threshold for entries
self.exit_threshold = thresholds['exit_threshold'] # Lower threshold for exits
self.uninvested_threshold = thresholds['uninvested_threshold'] # Stay out threshold
logger.info(f"Dynamic Pivot-Based Thresholds:")
logger.info(f"Pivot-Based Thresholds:")
logger.info(f" Entry threshold: {self.entry_threshold:.3f} (more certain)")
logger.info(f" Exit threshold: {self.exit_threshold:.3f} (easier to exit)")
logger.info(f" Uninvested threshold: {self.uninvested_threshold:.3f} (stay out when uncertain)")