mirror of
https://github.com/chrisnov-it/quantumbotx.git
synced 2026-07-27 18:57:47 +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
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
import sqlite3
|
|
import os
|
|
|
|
# Nama file database
|
|
DB_FILE = "bots.db"
|
|
|
|
def migrate_database():
|
|
"""Migrate the database to add the enable_strategy_switching column"""
|
|
try:
|
|
# Check if database exists
|
|
if not os.path.exists(DB_FILE):
|
|
print(f"Database file '{DB_FILE}' not found. Run init_db.py first.")
|
|
return False
|
|
|
|
# Connect to database
|
|
conn = sqlite3.connect(DB_FILE)
|
|
cursor = conn.cursor()
|
|
|
|
# Check if the column already exists
|
|
cursor.execute("PRAGMA table_info(bots)")
|
|
columns = [column[1] for column in cursor.fetchall()]
|
|
|
|
if 'enable_strategy_switching' in columns:
|
|
print("Column 'enable_strategy_switching' already exists in bots table.")
|
|
conn.close()
|
|
return True
|
|
|
|
# Add the new column
|
|
cursor.execute("ALTER TABLE bots ADD COLUMN enable_strategy_switching INTEGER NOT NULL DEFAULT 0")
|
|
conn.commit()
|
|
print("Successfully added 'enable_strategy_switching' column to bots table.")
|
|
|
|
conn.close()
|
|
return True
|
|
|
|
except sqlite3.Error as e:
|
|
print(f"Database error: {e}")
|
|
return False
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
return False
|
|
|
|
if __name__ == '__main__':
|
|
print("Migrating database to add strategy switching support...")
|
|
success = migrate_database()
|
|
if success:
|
|
print("Database migration completed successfully!")
|
|
else:
|
|
print("Database migration failed!") |