main dash cob integration
This commit is contained in:
31
main.py
31
main.py
@ -122,34 +122,47 @@ def start_web_ui():
|
||||
logger.info("=" * 50)
|
||||
logger.info("Starting Main Trading Dashboard UI...")
|
||||
logger.info("Trading Dashboard: http://127.0.0.1:8051")
|
||||
logger.info("COB Integration: ENABLED (Real-time order book visualization)")
|
||||
logger.info("=" * 50)
|
||||
|
||||
# Import and create the main TradingDashboard (simplified approach)
|
||||
# Import and create the main TradingDashboard with COB integration
|
||||
from web.dashboard import TradingDashboard
|
||||
from core.data_provider import DataProvider
|
||||
from core.orchestrator import TradingOrchestrator
|
||||
from core.enhanced_orchestrator import EnhancedTradingOrchestrator # Use enhanced version with COB
|
||||
from core.trading_executor import TradingExecutor
|
||||
|
||||
# Initialize components for the dashboard
|
||||
config = get_config()
|
||||
data_provider = DataProvider()
|
||||
|
||||
# Create orchestrator for the dashboard (standard version for UI compatibility)
|
||||
dashboard_orchestrator = TradingOrchestrator(data_provider=data_provider)
|
||||
# Load model registry for enhanced features
|
||||
try:
|
||||
from models import get_model_registry
|
||||
model_registry = {} # Use simple dict for now
|
||||
except ImportError:
|
||||
model_registry = {}
|
||||
|
||||
trading_executor = TradingExecutor()
|
||||
# Create enhanced orchestrator for the dashboard (WITH COB integration)
|
||||
dashboard_orchestrator = EnhancedTradingOrchestrator(
|
||||
data_provider=data_provider,
|
||||
symbols=config.get('symbols', ['ETH/USDT']),
|
||||
enhanced_rl_training=True, # Enable RL training display
|
||||
model_registry=model_registry
|
||||
)
|
||||
|
||||
# Create the main trading dashboard
|
||||
trading_executor = TradingExecutor("config.yaml")
|
||||
|
||||
# Create the main trading dashboard with enhanced features
|
||||
dashboard = TradingDashboard(
|
||||
data_provider=data_provider,
|
||||
orchestrator=dashboard_orchestrator,
|
||||
trading_executor=trading_executor
|
||||
)
|
||||
|
||||
logger.info("Main TradingDashboard created successfully")
|
||||
logger.info("Features: Live trading, RL training monitoring, Position management")
|
||||
logger.info("Enhanced TradingDashboard created successfully")
|
||||
logger.info("Features: Live trading, COB visualization, RL training monitoring, Position management")
|
||||
|
||||
# Run the dashboard server (simplified - no async loop)
|
||||
# Run the dashboard server (COB integration will start automatically)
|
||||
dashboard.app.run(host='127.0.0.1', port=8051, debug=False, use_reloader=False)
|
||||
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user