HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/af/src/demo_forex_agents.py
"""
Demo script for forex trading agents.

This script demonstrates how to use the forex trading agents 
individually and as a team.
"""

import logging
import os
from dotenv import load_dotenv

from src.ai.forex_agents import (
    FXSeerLSTMAgent,
    TrendSightTAAgent,
    MomentumMoverAgent,
    MeanReversionScoutAgent,
    create_forex_team
)

# Load environment variables
load_dotenv()

# Configure logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

def demo_individual_agents():
    """Demo each forex agent individually"""
    
    print("\n=== INDIVIDUAL AGENT DEMO ===\n")
    
    # Create individual agents
    lstm_agent = FXSeerLSTMAgent()
    ta_agent = TrendSightTAAgent()
    momentum_agent = MomentumMoverAgent()
    mean_reversion_agent = MeanReversionScoutAgent()
    
    # Demo FXSeer LSTM Agent
    print("\n--- FXSeer LSTM Agent Demo ---\n")
    lstm_response = lstm_agent.chat("What's your prediction for EUR/USD for tomorrow?")
    print(f"LSTM Agent Response:\n{lstm_response}")
    
    # Demo TrendSight TA Agent
    print("\n--- TrendSight TA Agent Demo ---\n")
    ta_response = ta_agent.chat("Analyze GBP/JPY on the daily timeframe using RSI and Bollinger Bands.")
    print(f"TA Agent Response:\n{ta_response}")
    
    # Demo Momentum Mover Agent
    print("\n--- Momentum Mover Agent Demo ---\n")
    momentum_response = momentum_agent.chat("Show me the top momentum pairs from this list: EUR/USD, GBP/USD, USD/JPY, AUD/USD")
    print(f"Momentum Agent Response:\n{momentum_response}")
    
    # Demo Mean Reversion Scout Agent
    print("\n--- Mean Reversion Scout Agent Demo ---\n")
    reversion_response = mean_reversion_agent.chat("Find mean reversion opportunities for USD/CAD using Z-Score method.")
    print(f"Mean Reversion Agent Response:\n{reversion_response}")

def demo_team_collaboration():
    """Demo the forex team collaboration"""
    
    print("\n=== FOREX TEAM COLLABORATION DEMO ===\n")
    
    # Create the forex team
    forex_team = create_forex_team()
    
    # Team analysis example
    print("\n--- Comprehensive Forex Analysis ---\n")
    team_response = forex_team.chat("""
    I'm looking at EUR/USD and interested in trading it. 
    Can you provide a comprehensive analysis including:
    1. Technical indicators
    2. Price prediction
    3. Momentum status
    4. Mean reversion potential
    """)
    print(f"Team Response:\n{team_response}")

if __name__ == "__main__":
    logger.info("Starting Forex Agents Demo")
    
    try:
        # Demo individual agents
        demo_individual_agents()
        
        # Demo team collaboration
        demo_team_collaboration()
        
    except Exception as e:
        logger.error(f"Error in demo: {e}", exc_info=True)
    
    logger.info("Forex Agents Demo completed")