mirror of
https://github.com/chrisnov-it/quantumbotx.git
synced 2026-07-28 03:07:53 +00:00
eb33b7c6ea
🔧 Core System Improvements: - Enhanced backtesting engine with realistic spread modeling and ATR-based risk management - Improved bot controller with better error handling and status tracking - Optimized MT5 integration with symbol verification and market watch integration - Strengthened database queries with better performance and reliability 🎯 New Strategy Features: - Added index strategies (Index Momentum, Index Breakout Pro) for stock market trading - Implemented market condition detector for dynamic strategy adaptation - Created performance scorer for strategy evaluation and ranking - Added strategy switcher system for automatic strategy optimization 📚 Educational Framework: - New beginner guide documentation for newcomer onboarding - Enhanced FAQ section with common trading questions - Quick start guide for rapid setup and deployment - Improved AI mentor integration with personalized guidance 🌍 Multi-Asset Expansion: - Extended data collection for 20+ trading instruments (Forex, Crypto, Indices) - Enhanced broker compatibility with FBS and other platforms - Improved symbol migration system for seamless broker switching - Added holiday integration for culturally-aware trading automation 🧪 Testing & Validation: - Added comprehensive index strategy testing suite - Enhanced holiday integration validation - Dynamic strategy signal testing for improved reliability - EURUSD optimization testing with London session focus ⚡ Performance & UI: - Frontend JavaScript optimizations for better trading bot management - Enhanced templates with improved user experience - Database migration system for smooth version upgrades - Optimized data download scripts for better efficiency 📊 Analytics & Monitoring: - Strengthened Flask application architecture with better routing - Improved logging system for production deployment - Enhanced error handling across all components - Better API response handling and status reporting
78 lines
3.3 KiB
Python
78 lines
3.3 KiB
Python
# testing/test_holiday_integration.py
|
|
"""
|
|
Test script for holiday integration features
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
from core.seasonal.holiday_manager import holiday_manager
|
|
|
|
def test_holiday_detection():
|
|
"""Test holiday detection functionality"""
|
|
print("Testing Holiday Detection...")
|
|
|
|
# Test current holiday detection
|
|
current_holiday = holiday_manager.get_current_holiday_mode()
|
|
if current_holiday:
|
|
print(f"✓ Active holiday: {current_holiday.name}")
|
|
print(f"✓ Period: {current_holiday.start_date} to {current_holiday.end_date}")
|
|
print(f"✓ Greeting: {holiday_manager.get_holiday_greeting()}")
|
|
else:
|
|
print("✓ No active holiday")
|
|
|
|
# Test Ramadan features when active
|
|
ramadan_features = holiday_manager.get_ramadan_features()
|
|
if ramadan_features:
|
|
print("✓ Ramadan features available:")
|
|
if 'iftar_countdown' in ramadan_features:
|
|
countdown = ramadan_features['iftar_countdown']
|
|
print(f" - Iftar countdown: {countdown['hours']}h {countdown['minutes']}m until {countdown['next_prayer']}")
|
|
if 'patience_reminder' in ramadan_features:
|
|
print(f" - Patience reminder: {ramadan_features['patience_reminder']}")
|
|
else:
|
|
print("✓ No Ramadan features (not active)")
|
|
|
|
# Test risk multiplier
|
|
risk_multiplier = holiday_manager.get_risk_multiplier()
|
|
print(f"✓ Current risk multiplier: {risk_multiplier}")
|
|
|
|
# Test trading pause status
|
|
is_paused = holiday_manager.is_trading_paused()
|
|
print(f"✓ Trading paused: {is_paused}")
|
|
|
|
if is_paused:
|
|
current_holiday = holiday_manager.get_current_holiday_mode()
|
|
if current_holiday and current_holiday.name == "Ramadan Trading Mode":
|
|
# Check which prayer time is causing the pause
|
|
from datetime import datetime
|
|
now = datetime.now()
|
|
current_time = (now.hour, now.minute)
|
|
|
|
adjustments = current_holiday.trading_adjustments
|
|
|
|
# Check Sahur pause
|
|
if 'sahur_pause' in adjustments:
|
|
start_hour, start_min, end_hour, end_min = adjustments['sahur_pause']
|
|
if (start_hour, start_min) <= current_time <= (end_hour, end_min):
|
|
print(" - Pause reason: Sahur time - time for spiritual reflection and preparation")
|
|
|
|
# Check Iftar pause
|
|
if 'iftar_pause' in adjustments:
|
|
start_hour, start_min, end_hour, end_min = adjustments['iftar_pause']
|
|
if (start_hour, start_min) <= current_time <= (end_hour, end_min):
|
|
print(" - Pause reason: Iftar time - breaking fast and family time")
|
|
|
|
# Check Tarawih pause
|
|
if 'tarawih_pause' in adjustments:
|
|
start_hour, start_min, end_hour, end_min = adjustments['tarawih_pause']
|
|
if (start_hour, start_min) <= current_time <= (end_hour, end_min):
|
|
print(" - Pause reason: Tarawih prayers - spiritual devotion time")
|
|
|
|
if __name__ == "__main__":
|
|
print("Holiday Integration Test")
|
|
print("=" * 30)
|
|
test_holiday_detection()
|
|
print("=" * 30)
|
|
print("Test completed successfully!") |