diff --git a/.env.example b/.env.example index e5b4fd2..79ba8e9 100644 --- a/.env.example +++ b/.env.example @@ -1,34 +1,12 @@ # Flask Configuration -FLASK_APP=run.py -FLASK_ENV=development -FLASK_DEBUG=True +FLASK_DEBUG=False +FLASK_HOST=127.0.0.1 +FLASK_PORT=5000 -# Server Configuration -HOST=0.0.0.0 -PORT=5000 +# MT5 Configuration (required for local development) +MT5_LOGIN=your_mt5_account_number +MT5_PASSWORD=your_mt5_password +MT5_SERVER=your_mt5_server -# Database Configuration (SQLite default) -DATABASE_URL=sqlite:///database.db - -# MT5 Configuration (REQUIRED for data downloading) -MT5_LOGIN=your_mt5_account_number_here -MT5_PASSWORD=your_mt5_password_here -MT5_SERVER=your_mt5_broker_server_here -# Example for FBS Demo: FBS-Demo -# Example for XM Global: XMGlobal-ServerName - -# MT5 Installation Paths (OPTIONAL - auto-detected if not specified) -MT5_TERMINAL_PATH=C:\Program Files\MetaTrader 5 -MT5_DATA_PATH=%APPDATA%\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075 - -# Advanced MT5 Settings -MT5_TIMEOUT_SECONDS=60 - -# Backtesting Configuration -BACKTEST_LOG_LEVEL=INFO - -# Application Settings -SECRET_KEY=your-secret-key-here-make-it-very-long-and-random - -# Additional MT5 Symbols (comma-separated) -CUSTOM_MT5_SYMBOLS=GBPAUD,NZDCAD,USDMXN +# Skip MT5 initialization in deployment environments (Vercel, etc.) +SKIP_MT5_INIT=0 diff --git a/.gitignore b/.gitignore index 47b9343..a56f877 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,5 @@ DESKTOP_DEPLOYMENT.md INVESTMENT_RETURN.md PAYMENT_SETUP.md STRATEGY_IDEAS.md + +.vercel diff --git a/MT5_SETUP_GUIDE.md b/MT5_SETUP_GUIDE.md index 372a436..156f960 100644 --- a/MT5_SETUP_GUIDE.md +++ b/MT5_SETUP_GUIDE.md @@ -1,3 +1,4 @@ +/** eslint-disable markdown/fenced-code-language */ # š QuantumBotX MT5 Integration Guide > **Get Historical Market Data for Advanced Backtesting** diff --git a/PACKAGING_README.md b/PACKAGING_README.md new file mode 100644 index 0000000..32e3fc8 --- /dev/null +++ b/PACKAGING_README.md @@ -0,0 +1,194 @@ +# QuantumBotX Windows Packaging Guide + +This guide explains how to package your QuantumBotX trading application into a Windows installer for distribution to non-technical users. + +## šÆ What This Packaging Solution Provides + +ā **Single EXE Installer** - Professional Windows installer +ā **One-Click Installation** - Simple for end users +ā **Desktop Shortcuts** - Easy application access +ā **Uninstaller** - Clean removal capability +ā **Setup Wizard** - Automated first-time setup +ā **User-Friendly Scripts** - Simple startup process +ā **Comprehensive Documentation** - Clear instructions for users + +## š Prerequisites + +### For Building the Package +1. **Python 3.8+** (already installed) +2. **PyInstaller** (already installed via this guide) +3. **NSIS (Optional)** - For creating the installer EXE + - Download from: https://nsis.sourceforge.io/Download + - Install and ensure `makensis` is in your PATH + +### For End Users +1. **Windows 7+** (64-bit recommended) +2. **MetaTrader 5** - Must be installed separately +3. **Internet Connection** - For initial setup + +## š Quick Start + +### Option 1: Build Everything (Recommended) +```bash +python build_installer.py +``` + +### Option 2: Manual Build Process +```bash +# 1. Build with PyInstaller +pyinstaller --clean quantumbotx.spec + +# 2. Create portable version (optional) +python -c "import zipfile; zipf=zipfile.ZipFile('QuantumBotX-Portable.zip','w',8); [zipf.write(f,f) for d in ['dist/QuantumBotX','.'] for f in [os.path.join(r,d) for r,_,fs in os.walk(d) for f in fs]]" + +# 3. Create installer (requires NSIS) +makensis installer.nsi +``` + +## š Generated Files + +After successful build, you'll have: + +```txt +QuantumBotX-Installer.exe # Main Windows installer +QuantumBotX-Portable.zip # Portable version (alternative) +dist/QuantumBotX/ # PyInstaller output (for troubleshooting) +``` + +## š® For End Users + +### Installation Process +1. **Download** `QuantumBotX-Installer.exe` +2. **Run** the installer (requires admin privileges) +3. **Follow** the setup wizard +4. **Launch** from desktop shortcut or start menu + +### Daily Usage +1. **Start MetaTrader 5** first +2. **Launch QuantumBotX** via desktop shortcut or start menu +3. **Open browser** to http://127.0.0.1:5000 +4. **Configure settings** if needed + +## š§ Configuration Files + +The installer includes these configuration files: + +- **`.env.example`** - Template for environment variables +- **`start.bat`** - Windows startup script +- **`setup_quantumbotx.py`** - Setup wizard for first run +- **`QUICK_START_GUIDE.md`** - User instructions + +## š ļø Troubleshooting + +### Build Issues + +**PyInstaller fails:** +```bash +# Clean and rebuild +pyinstaller --clean quantumbotx.spec +``` + +**NSIS not found:** +- Install NSIS from https://nsis.sourceforge.io/ +- Or use the portable version instead + +**Missing dependencies:** +```bash +pip install -r requirements.txt +``` + +### Runtime Issues + +**Application won't start:** +- Check if MetaTrader 5 is running +- Verify `.env` file has correct credentials +- Check Windows Event Viewer for errors + +**Port already in use:** +- Close other applications using port 5000 +- Or modify `FLASK_PORT` in `.env` file + +**MetaTrader 5 connection fails:** +- Verify MT5 credentials in `.env` +- Ensure MT5 is running and logged in +- Check MT5 terminal for connection status + +## š¦ Distribution + +### For Technical Users +- Share `QuantumBotX-Installer.exe` for full installation +- Or share `QuantumBotX-Portable.zip` for manual installation + +### For Non-Technical Users +1. **Share the installer** `QuantumBotX-Installer.exe` +2. **Provide simple instructions:** + - Double-click to install + - Follow the setup wizard + - Use desktop shortcut to launch + - Ensure MetaTrader 5 is running + +### System Requirements for End Users +- **OS:** Windows 7 SP1+ (64-bit recommended) +- **RAM:** 4GB minimum, 8GB recommended +- **Storage:** 500MB free space +- **Network:** Internet connection for initial setup +- **Software:** MetaTrader 5 (installed separately) + +## š Updates and Maintenance + +### Creating Updates +1. **Increment version** in `installer.nsi` +2. **Rebuild** using `python build_installer.py` +3. **Test** on clean system +4. **Distribute** new installer + +### Uninstallation +- Use Windows Add/Remove Programs +- Or run `Uninstall.exe` from installation directory +- Or use the uninstall shortcut in Start Menu + +## š Support + +### Common User Questions + +**"How do I configure my MT5 credentials?"** +- Copy `.env.example` to `.env` +- Edit `.env` with your MT5 account details +- Restart the application + +**"The application says MT5 is not connected"** +- Ensure MetaTrader 5 is running +- Check MT5 login credentials +- Verify MT5 server settings + +**"I can't access the web interface"** +- Check if the application is running +- Verify the URL: http://127.0.0.1:5000 +- Check firewall settings + +## šÆ Advanced Configuration + +### Customizing the Installer +Edit `installer.nsi` to: +- Change installation directory +- Modify shortcuts +- Add custom messages +- Include additional files + +### Customizing PyInstaller +Edit `quantumbotx.spec` to: +- Add/remove files +- Change executable properties +- Modify hidden imports +- Customize build options + +## š Getting Help + +1. **Check the logs** in the `logs/` directory +2. **Review** `QUICK_START_GUIDE.md` +3. **Consult** `README.md` for technical details +4. **Check** MetaTrader 5 documentation for connection issues + +--- + +**š Your application is now ready for distribution to non-technical users!** diff --git a/QUICK_START_GUIDE.md b/QUICK_START_GUIDE.md new file mode 100644 index 0000000..a448c68 --- /dev/null +++ b/QUICK_START_GUIDE.md @@ -0,0 +1,47 @@ +# QuantumBotX - Quick Start Guide + +## First Time Setup + +1. **Install MetaTrader 5** (Required) + - Download from: https://www.metatrader5.com/ + - Install and create a demo account + - Keep MT5 running in the background + - ā ļø **IMPORTANT:** MetaTrader 5 must be running for QuantumBotX to work + +2. **Configure Your Settings** + - Copy `.env.example` to `.env` + - Edit `.env` with your MT5 credentials: + ```ini + MT5_LOGIN=your_account_number + MT5_PASSWORD=your_password + MT5_SERVER=your_server_name + ``` + +3. **Start the Application** + - Double-click `start.bat` (Windows) + - Open http://127.0.0.1:5000 in your browser + +## ā System Requirements + +- **Windows 7 SP1 or later** (64-bit recommended) +- **MetaTrader 5** (must be installed separately) +- **4GB RAM minimum** (8GB recommended) +- **500MB free disk space** +- **Internet connection** for initial setup +- **ā Python NOT required** (already bundled in the installer) + +## Daily Use + +1. Start MetaTrader 5 first +2. Run `start.bat` +3. Open your web browser to http://127.0.0.1:5000 + +## Troubleshooting + +- Make sure MetaTrader 5 is running +- Check your .env file has correct credentials +- If the app won't start, try running `python run.py` directly + +## Support + +If you need help, check the README.md file or contact support. diff --git a/ROADMAP.md b/ROADMAP.md index 5c75ba6..b66051d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,218 +1,52 @@ -# š QuantumBotX Product Roadmap 2025-2026 +# š QuantumBotX Development Roadmap -> **From Local MT5 Platform ā Global Cloud Trading System** +**š Stay Tuned for Exciting Updates!** + +## šÆ **What's Coming Next** + +### **Q4 2025: Intelligence Enhancement** +- **Advanced AI Features**: Enhanced strategy analysis with machine learning +- **Real-time Notifications**: Telegram integration for trade alerts +- **Portfolio Analytics**: Advanced performance dashboards +- **Enterprise Features**: Multi-account management and compliance logging + +### **Exciting New Project** š +We're developing **QuantumBotX API** - a revolutionary cloud-based trading platform that will give users unprecedented freedom: + +> **"Trade anywhere, anytime, with any broker - no local installations required!"** + +**QuantumBotX API will feature:** +- š **Cloud-native architecture** - Run on any device, anywhere +- š **Direct broker integration** - No intermediaries, pure API trading +- š **Cross-broker support** - IC Markets, Pepperstone, and beyond +- ā” **Real-time execution** - Ultra-low latency trade processing +- š **Advanced education** - Built-in learning with community support + +### **Timeline** +- **Q4 2025**: Closed beta testing with select users +- **Q1 2026**: Public beta launch with premium support +- **Q2 2026**: Full global launch with subscription tiers --- -## š **Current Status: v2.0.3 - Global Expansion Complete** -ā **Multilingual Support**: Indonesian & English fully implemented -ā **Data Integration**: Smart MT5 detection with web controls -ā **Professional Documentation**: Comprehensive setup guides -ā **User Experience**: Streamlined onboarding and settings +## š¤ **Community & Support** + +**We're building more than software - we're building a trading community!** + +- **Discord Community**: Join our growing trader community +- **Educational Content**: Free trading courses and tutorials +- **Open Source**: Contribute to the project and shape its future +- **Mentorship Program**: One-on-one guidance for serious traders --- -## šÆ **Q4 2025: Stability & Market Penetration** +## šŗļø **Our Mission** -### **v2.1 - "Intelligence Enhancement"** (3 Months) +**Empowering traders worldwide with safe, educational, and profitable algorithmic trading solutions.** -#### š§ **AI & Analytics Features** -- ā **MACD_STOCH_FILTER Strategy**: Advanced precision entry system -- ā **Telegram Notifications**: Real-time alerts for trades/errors -- ā **Smart Parameter Optimization**: AI-assisted strategy tuning -- ā **Portfolio Analytics Dashboard**: Advanced risk/correlation analysis -- ā **Enhanced Market Regime Detection**: Multi-timeframe market analysis - -#### š **Advanced Reporting** -- ā **Performance Heatmaps**: Strategy performance visualization -- ā **Risk Attribution Analysis**: Which factors affect returns most -- ā **Monthly Reporting**: Automated performance summaries -- ā **Benchmarking System**: Compare against market indices - -#### š§ **Platform Improvements** -- ā **Multi-Account Management**: Handle multiple trading accounts -- ā **Strategy Cloning**: Duplicate and modify existing strategies -- ā **Bulk Operations**: Start/stop multiple bots simultaneously -- ā **API Rate Limiting**: Prevent excessive broker API calls - -### **Market Goals Q4** -- **GitHub Release**: Open-source launch with 200+ stars -- **Community Building**: Discord/Telegram groups with 500+ members -- **Education Focus**: Launch beginner YouTube channel -- **Broker Partnerships**: Initial deals with 2-3 brokers +*From local learning platform ā Global trading ecosystem!* šš« --- -## š **Q1 2026: Enterprise Features & API Foundation** - -### **v2.2 - "Enterprise Ready"** (3-4 Months) - -#### š¢ **Enterprise Features** -- ā **User Roles & Permissions**: Admin, Trader, Viewer roles -- ā **Audit Logging**: Complete action history for compliance -- ā **White-label Support**: Custom branding for firms -- ā **API Documentation**: REST endpoints for integrations - -#### š **External Integrations** -- ā **Discord Webhooks**: Trading alerts to Discord channels -- ā **Slack Notifications**: Team trading notifications -- ā **Email Automation**: Professional performance reports -- ā **Webhooks**: Custom integration support - -### **QuantumBotX API Research & Planning** ā” -**Timeline: Q1 2026** -- **Market Research**: Identify best broker API partners (IC Markets, Pepperstone focus) -- **Technical Architecture**: Design microservices for cloud deployment -- **Security Planning**: API key management and authentication systems -- **Prototype Development**: Proof-of-concept API trading endpoints - -### **Market Goals Q1** -- **10,000 Downloads**: Aggressive growth with community marketing -- **Enterprise Pilot**: First institutional client deployment -- **Language Expansion**: Chinese interface preparation -- **Subscription Model**: Freemium to pro upgrade conversion testing - ---- - -## š **Q2-Q3 2026: API Platform Launch** - -### **QuantumBotX API v1.0 - "Cloud Liberation"** š - -#### šÆ **Core API Features** -- ā **Direct Broker API Integration**: No MT5 terminal required! -- ā **Cross-Platform Support**: Windows, Mac, Linux, VPS, Cloud -- ā **Multi-Broker Support**: IC Markets, Pepperstone, Key brokers -- ā **24/7 Trading**: Server-based operation - -#### šļø **Technical Implementation** -- ā **Microservices Architecture**: Website (Flask) + Trading Engine (FastAPI) -- ā **Docker Orchestration**: Containerized deployment -- ā **WebSocket Streaming**: Real-time market data -- ā **REST API Trading**: Place/exit trades programmatically - -#### š° **Supported Brokers (Phase 1)** -- ā **IC Markets**: Primary focus, excellent API documentation -- ā **Pepperstone**: Enterprise-grade API support -- ā **Deriv**: Binary/forex options integration -- ā **Additional**: Research and partnership development - -#### š **Business Model** -- ā **Free Tier**: Basic features for individual traders -- ā **Pro Subscription**: $29/month - Unlimited brokers/signals -- ā **Enterprise Tier**: $299/month - White-label + custom features -- ā **Broker Partnerships**: Revenue sharing per active trader - -### **Current MT5 Version (Maintenance Mode)** -- ā **Continued Support**: Windows users still supported -- ā **Learning Path**: Beginner education funnel to API version -- ā **Feature Parity**: API features backported where possible - -### **API Launch Strategy** -1. **Closed Beta**: 100 users, fee waivers for feedback -2. **Public Beta**: 1,000 users, premium support -3. **Full Launch**: Global availability with paid subscriptions -4. **Partnership Program**: Broker incentives for integrations - ---- - -## š **Q4 2026: Scale & Expansion** - -### **QuantumBotX API v2.0 - "Global Domination"** š - -#### š **International Expansion** -- ā **Multi-Language Support**: Chinese, Arabic, Spanish, Russian -- ā **Regional Broker Focus**: Local broker partnerships -- ā **Cultural Customization**: Holiday awareness per region -- ā **Localized Education**: Region-specific trading content - -#### š **Advanced Features** -- ā **AI Strategy Optimization**: ML-based parameter tuning -- ā **Portfolio Management**: Multi-strategy allocation -- ā **Arbitrage Engine**: Cross-broker opportunity scanning -- ā **Community Marketplace**: User-created strategy sharing - -#### š° **Revenue Targets** -- **Base**: 5,000 paid subscribers @ $29/month ($1.74M ARR) -- **Enterprise**: 20 clients @ $299/month ($718K ARR) -- **Total Target**: $2.45M ARR by end of 2026 - ---- - -## šÆ **Key Success Metrics** - -### **Technical KPIs** -- ā **99.9% Uptime**: Cloud-based reliability -- ā **<5ms Latency**: Low-latency trade execution -- ā **Zero Broker Disconnects**: Robust connection handling -- ā **Real-time Performance**: Sub-second signal generation - -### **Business KPIs** -- ā **Community Size**: 10,000+ active traders -- ā **Market Coverage**: 50+ countries reached -- ā **Broker Partnerships**: 10+ integrated brokers -- ā **Conversion Rate**: 15% free ā paid upgrade rate - -### **Product KPIs** -- ā **Strategy Performance**: Consistently beating benchmarks -- ā **User Satisfaction**: 4.8+ star ratings -- ā **Educational Value**: Proven learning outcomes -- ā **Risk Management**: Zero significant account losses - ---- - -## š” **Key Competitive Advantages** - -### **Vs Traditional Platforms** -- ā **Education First**: Learning-focused vs profit-focused -- ā **Conservative Approach**: Risk management prioritized -- ā **Cultural Intelligence**: Indonesian market psychology - -### **Vs Other Trading Bots** -- ā **Multi-Broker Freedom**: Not locked to one platform -- ā **Strategy Transparency**: Open-source strategy evaluation -- ā **Community Building**: Collaborative improvement - -### **Vs API-Only Solutions** -- ā **Complete Platform**: Not just APIs, full trading system -- ā **Educational Framework**: Learning built-in -- ā **Risk Management**: Conservative by default - ---- - -## šļø **Development Principles** - -### **User-Centric Development** -- **Safety First**: Every feature vetted for risk management -- **Education Priority**: Learning > Profits mindset -- **Inclusive Design**: Support traders of all experience levels - -### **Technical Excellence** -- **Microservices**: Scalable, maintainable architecture -- **Security First**: Financial data protection paramount -- **Performance Obsessed**: Low latency, high reliability - -### **Sustainable Growth** -- **Open Source Roots**: Community contributions welcomed -- **Transparent Pricing**: No surprise fees or commissions -- **Ethical Practices**: No predatory monetization - ---- - -## š **Mission Achievement Timeline** - -### **2025 Goals** -- ā Launch Windows MT5 platform -- ā Build Indonesian trading community -- ā Establish educational reputation -- ā Research API broker partnerships - -### **2026 Goals** -- š§ Launch QuantumBotX API platform -- š§ Achieve 10,000+ active users -- š§ Generate $2M+ annual revenue -- š§ Become leading algorithmic trading education platform - ---- - -**Roadmap Last Updated: September 2025** -*Version: Comprehensive Expansion Plan* šš® +**Roadmap Updated: September 2025** + diff --git a/api/app.py b/api/app.py new file mode 100644 index 0000000..ab1d42f --- /dev/null +++ b/api/app.py @@ -0,0 +1,10 @@ +import os +from core import create_app + +# Set environment to skip MT5 initialization on Vercel +os.environ['SKIP_MT5_INIT'] = '1' + +app = create_app() + +if __name__ == '__main__': + app.run() diff --git a/build_installer.py b/build_installer.py new file mode 100644 index 0000000..9f464a3 --- /dev/null +++ b/build_installer.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python3 +""" +QuantumBotX Windows Installer Builder +Builds the complete installer package for distribution +""" + +import os +import sys +import subprocess +import shutil +from pathlib import Path + +def run_command(command, shell=True, cwd=None): + """Run a command and return the result.""" + try: + print(f"Running: {command}") + result = subprocess.run(command, shell=shell, cwd=cwd, capture_output=True, text=True) + if result.stdout: + print(result.stdout) + if result.stderr: + print(result.stderr, file=sys.stderr) + return result.returncode == 0, result.stdout, result.stderr + except Exception as e: + return False, "", str(e) + +def check_requirements(): + """Check if all required tools are installed.""" + print("Checking requirements...") + + # Check PyInstaller + success, _, _ = run_command("pyinstaller --version") + if not success: + print("ā PyInstaller not found. Installing...") + run_command("pip install pyinstaller") + + # Check NSIS (we'll assume it's installed or provide instructions) + print("ā PyInstaller found") + + # Check if favicon exists for installer icon + if not os.path.exists("static/favicon.ico"): + print("ā ļø Warning: static/favicon.ico not found. Installer will use default icon.") + + return True + +def clean_previous_builds(): + """Clean previous build artifacts.""" + print("Cleaning previous builds...") + + directories_to_clean = [ + "build", + "dist", + "__pycache__", + "*.spec~" + ] + + for path in directories_to_clean: + if os.path.exists(path): + if os.path.isfile(path): + os.remove(path) + else: + shutil.rmtree(path) + print(f" Cleaned: {path}") + + # Clean Python cache + for root, dirs, files in os.walk("."): + for dir_name in dirs: + if dir_name == "__pycache__": + pycache_path = os.path.join(root, dir_name) + shutil.rmtree(pycache_path) + print(f" Cleaned: {pycache_path}") + +def build_with_pyinstaller(): + """Build the application using PyInstaller.""" + print("Building with PyInstaller...") + + # Build the executable + success, stdout, stderr = run_command("pyinstaller --clean quantumbotx.spec") + + if not success: + print(f"ā PyInstaller build failed: {stderr}") + return False + + print("ā PyInstaller build completed successfully") + return True + +def create_installer(): + """Create the Windows installer using NSIS.""" + print("Creating Windows installer...") + + # Check if NSIS is installed + success, _, _ = run_command("makensis /VERSION") + if not success: + print("ā NSIS not found!") + print("Please install NSIS from: https://nsis.sourceforge.io/Download") + print("Or download from: https://nsis.sourceforge.io/Download") + print() + print("Alternative: You can manually install the application by:") + print("1. Running the PyInstaller build") + print("2. Copying the dist/QuantumBotX folder to the target computer") + print("3. Running setup_quantumbotx.py on the target computer") + return False + + # Create the installer + success, stdout, stderr = run_command("makensis installer.nsi") + + if not success: + print(f"ā NSIS build failed: {stderr}") + return False + + print("ā Windows installer created successfully") + return True + +def create_portable_package(): + """Create a portable ZIP package as alternative.""" + print("Creating portable ZIP package...") + + try: + import zipfile + + # Create portable package + portable_name = "QuantumBotX-Portable.zip" + + with zipfile.ZipFile(portable_name, 'w', zipfile.ZIP_DEFLATED) as zipf: + # Add the main executable and supporting files + dist_path = Path("dist/QuantumBotX") + if dist_path.exists(): + for file_path in dist_path.rglob("*"): + if file_path.is_file(): + arcname = file_path.relative_to("dist") + zipf.write(file_path, arcname) + + # Add additional files + additional_files = [ + "start.bat", + "start.sh", + "setup_quantumbotx.py", + "requirements.txt", + ".env.example", + "README.md", + "QUICK_START_GUIDE.md", + "MT5_SETUP_GUIDE.md" + ] + + for file_name in additional_files: + if os.path.exists(file_name): + zipf.write(file_name, file_name) + + print(f"ā Portable package created: {portable_name}") + return True + + except ImportError: + print("ā ļø zipfile not available, skipping portable package") + return False + except Exception as e: + print(f"ā Error creating portable package: {e}") + return False + +def main(): + """Main build function.""" + print("QuantumBotX Windows Installer Builder") + print("====================================") + print() + + # Check requirements + if not check_requirements(): + print("ā Requirements check failed") + input("Press Enter to exit...") + return + + # Clean previous builds + clean_previous_builds() + + # Build with PyInstaller + if not build_with_pyinstaller(): + print("ā PyInstaller build failed") + input("Press Enter to exit...") + return + + # Create installer + installer_created = create_installer() + + # Create portable package as backup + create_portable_package() + + print() + if installer_created: + print("š Build Complete!") + print("==================") + print("ā Windows installer: QuantumBotX-Installer.exe") + print("ā Portable package: QuantumBotX-Portable.zip") + print() + print("Distribution files are ready in the current directory.") + print() + print("To test the installer:") + print("1. Copy QuantumBotX-Installer.exe to a test computer") + print("2. Run the installer") + print("3. Follow the setup wizard") + print() + else: + print("ā ļø Build Complete (Installer not available)") + print("=============================================") + print("ā Application executable: dist/QuantumBotX/") + print("ā Portable package: QuantumBotX-Portable.zip") + print() + print("Since NSIS is not installed, you have these options:") + print("1. Install NSIS and run this script again") + print("2. Use the portable version (dist/QuantumBotX/)") + print("3. Manually copy files to target computer") + print() + + print("Next steps for end users:") + print("1. Install MetaTrader 5") + print("2. Configure .env file with MT5 credentials") + print("3. Run start.bat to launch the application") + print() + + input("Press Enter to exit...") + +if __name__ == "__main__": + main() diff --git a/core/__init__.py b/core/__init__.py index a074f61..a03195b 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,10 +1,13 @@ # core/__init__.py import os +import sys import logging +import sqlite3 from logging.handlers import RotatingFileHandler from flask import Flask, render_template, send_from_directory from dotenv import load_dotenv +from werkzeug.security import generate_password_hash class RequestLogFilter(logging.Filter): """Filter untuk menghilangkan noise dari terminal log.""" @@ -58,6 +61,155 @@ class RequestLogFilter(logging.Filter): # Tampilkan semua request lainnya (termasuk GET yang error) return True +def init_database(): + """Initialize database and create tables if they don't exist.""" + try: + # Get the directory where the executable is located + if getattr(sys, 'frozen', False): + # Running as PyInstaller bundle + base_dir = os.path.dirname(sys.executable) + db_path = os.path.join(base_dir, 'bots.db') + else: + # Running as script + base_dir = os.path.dirname(os.path.abspath(__file__)) + db_path = os.path.join(base_dir, '..', '..', 'bots.db') + + # Create connection + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + + # Create users table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + email TEXT NOT NULL UNIQUE, + password_hash TEXT NOT NULL, + join_date DATETIME DEFAULT CURRENT_TIMESTAMP + ) + ''') + + # Create bots table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS bots ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + market TEXT NOT NULL, + status TEXT NOT NULL DEFAULT 'Dijeda', + lot_size REAL NOT NULL DEFAULT 0.01, + sl_pips INTEGER NOT NULL DEFAULT 100, + tp_pips INTEGER NOT NULL DEFAULT 200, + timeframe TEXT NOT NULL DEFAULT 'H1', + check_interval_seconds INTEGER NOT NULL DEFAULT 60, + strategy TEXT NOT NULL, + strategy_params TEXT, + enable_strategy_switching INTEGER NOT NULL DEFAULT 0 + ) + ''') + + # Create trade_history table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS trade_history ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + bot_id INTEGER NOT NULL, + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, + action TEXT NOT NULL, + details TEXT, + is_notification INTEGER NOT NULL DEFAULT 0, + is_read INTEGER NOT NULL DEFAULT 0, + FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE + ) + ''') + + # Create backtest_results table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS backtest_results ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, + strategy_name TEXT NOT NULL, + data_filename TEXT NOT NULL, + total_profit_usd REAL NOT NULL, + total_trades INTEGER NOT NULL, + win_rate_percent REAL NOT NULL, + max_drawdown_percent REAL NOT NULL, + wins INTEGER NOT NULL, + losses INTEGER NOT NULL, + equity_curve TEXT, + trade_log TEXT, + parameters TEXT + ) + ''') + + # Create trading_sessions table (AI Mentor) + cursor.execute(''' + CREATE TABLE IF NOT EXISTS trading_sessions ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_date DATE NOT NULL, + user_id INTEGER DEFAULT 1, + total_trades INTEGER NOT NULL DEFAULT 0, + total_profit_loss REAL NOT NULL DEFAULT 0.0, + emotions TEXT NOT NULL DEFAULT 'netral', + market_conditions TEXT NOT NULL DEFAULT 'normal', + personal_notes TEXT, + risk_score INTEGER DEFAULT 5, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE + ) + ''') + + # Create ai_mentor_reports table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS ai_mentor_reports ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id INTEGER NOT NULL, + trading_patterns_analysis TEXT, + emotional_analysis TEXT, + risk_management_score INTEGER, + recommendations TEXT, + motivation_message TEXT, + language TEXT DEFAULT 'bahasa_indonesia', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES trading_sessions (id) ON DELETE CASCADE + ) + ''') + + # Create daily_trading_data table + cursor.execute(''' + CREATE TABLE IF NOT EXISTS daily_trading_data ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id INTEGER NOT NULL, + bot_id INTEGER NOT NULL, + symbol TEXT NOT NULL, + entry_time DATETIME, + exit_time DATETIME, + profit_loss REAL NOT NULL, + lot_size REAL NOT NULL, + stop_loss_used BOOLEAN DEFAULT 0, + take_profit_used BOOLEAN DEFAULT 0, + risk_percent REAL, + strategy_used TEXT, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES trading_sessions (id) ON DELETE CASCADE, + FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE + ) + ''') + + # Check if default user exists + cursor.execute('SELECT COUNT(*) FROM users') + if cursor.fetchone()[0] == 0: + # Insert default user + default_password_hash = generate_password_hash('admin') + cursor.execute( + 'INSERT INTO users (name, email, password_hash) VALUES (?, ?, ?)', + ('Admin User', 'admin@quantumbotx.com', default_password_hash) + ) + + conn.commit() + conn.close() + + except Exception as e: + raise Exception(f"Database initialization failed: {e}") + # ============================ # APPLICATION FACTORY FUNCTION # ============================ @@ -66,13 +218,21 @@ def create_app(): Membuat dan mengkonfigurasi instance aplikasi Flask. """ load_dotenv() - + app = Flask( - __name__, + __name__, instance_relative_config=True, template_folder='../templates', static_folder='../static' - ) + ) + + # Initialize database on startup + try: + init_database() + app.logger.info("Database initialized successfully") + except Exception as e: + app.logger.error(f"Failed to initialize database: {e}") + # Don't crash the app, but log the error app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'your-secret-key-here') # Konfigurasi logging yang lebih bersih @@ -203,4 +363,4 @@ def create_app(): return send_from_directory(os.path.join(app.root_path, 'static'), 'favicon.ico', mimetype='image/vnd.microsoft.icon') - return app \ No newline at end of file + return app diff --git a/core/db/connection.py b/core/db/connection.py index 2e1fa6d..0a40790 100644 --- a/core/db/connection.py +++ b/core/db/connection.py @@ -1,15 +1,24 @@ # core/db/connection.py import sqlite3 import os +import sys # Tentukan nama file database di satu tempat. DATABASE_FILENAME = 'bots.db' -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -DATABASE_PATH = os.path.join(BASE_DIR, '..', '..', DATABASE_FILENAME) def get_db_connection(): """Membuat dan mengembalikan koneksi ke database SQLite.""" - conn = sqlite3.connect(DATABASE_PATH) + # Get the directory where the executable is located + if getattr(sys, 'frozen', False): + # Running as PyInstaller bundle + base_dir = os.path.dirname(sys.executable) + db_path = os.path.join(base_dir, DATABASE_FILENAME) + else: + # Running as script + BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + db_path = os.path.join(BASE_DIR, '..', '..', DATABASE_FILENAME) + + conn = sqlite3.connect(db_path) # Mengatur agar hasil query bisa diakses seperti dictionary conn.row_factory = sqlite3.Row - return conn \ No newline at end of file + return conn diff --git a/install_mt5_integration.py b/install_mt5_integration.py index a47e60f..a7b2d89 100644 --- a/install_mt5_integration.py +++ b/install_mt5_integration.py @@ -10,7 +10,6 @@ import os import sys import subprocess import platform -import json import urllib.request from pathlib import Path diff --git a/installer.nsi b/installer.nsi new file mode 100644 index 0000000..886a0d5 --- /dev/null +++ b/installer.nsi @@ -0,0 +1,186 @@ +; QuantumBotX Windows Installer +; This script creates a Windows installer for the QuantumBotX trading application + +!include "MUI2.nsh" +!include "FileFunc.nsh" +!include "LogicLib.nsh" + +; General +Name "QuantumBotX Trading Bot" +OutFile "QuantumBotX-Installer.exe" +Unicode True +InstallDir "C:\QuantumBotX" +InstallDirRegKey HKCU "Software\QuantumBotX" "" +RequestExecutionLevel admin + +; Modern UI Configuration +!define MUI_ABORTWARNING +!define MUI_ICON "static\favicon.ico" +!define MUI_UNICON "static\favicon.ico" + +; Pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE.md" + +; Custom prerequisites page +Page custom PrerequisitesPage PrerequisitesPageLeave + +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +; Languages +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "Indonesian" + +; Version Information +VIProductVersion "2.0.0.0" +VIAddVersionKey "ProductName" "QuantumBotX Trading Bot" +VIAddVersionKey "CompanyName" "Chrisnov IT Solutions" +VIAddVersionKey "FileVersion" "2.0.0.0" +VIAddVersionKey "ProductVersion" "2.0.0.0" +VIAddVersionKey "FileDescription" "Professional Trading Bot Application" +VIAddVersionKey "LegalCopyright" "Copyright (c) 2025 Reynov Christian - Chrisnov IT Solutions" +VIAddVersionKey "Contact" "contact@chrisnov.com" + +Section "Install" + SetOutPath "$INSTDIR" + + ; Stop any running instances + DetailPrint "Stopping any running instances..." + nsExec::Exec 'taskkill /f /im "QuantumBotX.exe"' + + ; Create installation directory + CreateDirectory "$INSTDIR" + + ; Copy main files + File "dist\QuantumBotX\QuantumBotX.exe" + File /r "dist\QuantumBotX\_internal" + File "start.bat" + File "start.sh" + File "setup_quantumbotx.py" + File "requirements.txt" + File ".env.example" + File "README.md" + File "QUICK_START_GUIDE.md" + File "MT5_SETUP_GUIDE.md" + File /r "templates" + File /r "static" + File /r "core" + + ; Create data directories + CreateDirectory "$INSTDIR\logs" + CreateDirectory "$INSTDIR\lab" + CreateDirectory "$INSTDIR\testing" + CreateDirectory "$INSTDIR\docs" + + ; Copy optional directories if they exist + IfFileExists "docs\*.*" 0 +2 + File /r "docs" + + IfFileExists "lab\*.*" 0 +2 + File /r "lab" + + IfFileExists "testing\*.*" 0 +2 + File /r "testing" + + ; Create desktop shortcut + CreateShortCut "$DESKTOP\QuantumBotX.lnk" "$INSTDIR\start.bat" "" "$INSTDIR\start.bat" 0 + + ; Create start menu entries + CreateDirectory "$SMPROGRAMS\QuantumBotX" + CreateShortCut "$SMPROGRAMS\QuantumBotX\QuantumBotX.lnk" "$INSTDIR\start.bat" "" "$INSTDIR\start.bat" 0 + CreateShortCut "$SMPROGRAMS\QuantumBotX\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + + ; Store installation folder + WriteRegStr HKCU "Software\QuantumBotX" "" $INSTDIR + + ; Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + ; Write registry for Add/Remove Programs + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "DisplayName" "QuantumBotX Trading Bot" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "UninstallString" "$INSTDIR\Uninstall.exe" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "DisplayVersion" "2.0.0" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "Publisher" "Chrisnov IT Solutions" + WriteRegDWord HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "NoModify" 1 + WriteRegDWord HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" "NoRepair" 1 + +SectionEnd + +Section "Uninstall" + ; Remove files and directories + Delete "$INSTDIR\Uninstall.exe" + Delete "$INSTDIR\QuantumBotX.exe" + RMDir /r "$INSTDIR\_internal" + RMDir /r "$INSTDIR\templates" + RMDir /r "$INSTDIR\static" + RMDir /r "$INSTDIR\core" + RMDir /r "$INSTDIR\docs" + RMDir /r "$INSTDIR\lab" + RMDir /r "$INSTDIR\testing" + RMDir /r "$INSTDIR\logs" + Delete "$INSTDIR\*.*" + RMDir "$INSTDIR" + + ; Remove shortcuts + Delete "$DESKTOP\QuantumBotX.lnk" + RMDir /r "$SMPROGRAMS\QuantumBotX" + + ; Remove registry entries + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantumBotX" + DeleteRegKey /ifempty HKCU "Software\QuantumBotX" + + ; Stop running instances before uninstall + nsExec::Exec 'taskkill /f /im "QuantumBotX.exe"' + nsExec::Exec 'taskkill /f /im "python.exe"' + +SectionEnd + +Function .onInit + ; Check if already installed + ReadRegStr $R0 HKCU "Software\QuantumBotX" "" + ${If} $R0 != "" + MessageBox MB_YESNO "QuantumBotX is already installed. Do you want to reinstall?" IDYES continue + Abort + continue: + ${EndIf} + +FunctionEnd + +Function PrerequisitesPage + !insertmacro MUI_HEADER_TEXT "Prerequisites" "Important setup information" + + nsDialogs::Create 1018 + Pop $0 + + ${NSD_CreateLabel} 0 0 100% 24u "Before using QuantumBotX, you need to:" + Pop $0 + + ${NSD_CreateLabel} 0 30u 100% 60u "1. Install MetaTrader 5 from https://www.metatrader5.com/$\n2. Create a demo or live trading account$\n3. Keep MT5 running in background when using QuantumBotX$\n$\nā ļø Python is NOT required - it's already bundled in this installer!" + Pop $0 + + ${NSD_CreateLabel} 0 100u 100% 24u "System Requirements:" + Pop $0 + + ${NSD_CreateLabel} 0 130u 100% 40u "⢠Windows 7 SP1 or later (64-bit recommended)$\n⢠4GB RAM minimum (8GB recommended)$\n⢠500MB free disk space$\n⢠Internet connection for initial setup" + Pop $0 + + nsDialogs::Show +FunctionEnd + +Function PrerequisitesPageLeave + # This function is called when leaving the prerequisites page + # We could add validation here if needed +FunctionEnd + +Function .onInstSuccess + MessageBox MB_YESNO "Installation completed successfully! $\n$\nDo you want to run the setup wizard now?" IDNO end + Exec '"$INSTDIR\setup_quantumbotx.py"' + end: +FunctionEnd diff --git a/last_broker.json b/last_broker.json index 024a569..e54bb5b 100644 --- a/last_broker.json +++ b/last_broker.json @@ -1,5 +1,5 @@ { "broker": "FBS-Demo", "company": "FBS Markets Inc.", - "last_check": "2025-09-24T10:46:19.830283" + "last_check": "2025-10-09T12:17:45.370404" } \ No newline at end of file diff --git a/quantum_botx_shortcut.bat b/quantum_botx_shortcut.bat new file mode 100644 index 0000000..af67e02 --- /dev/null +++ b/quantum_botx_shortcut.bat @@ -0,0 +1,3 @@ +@echo off +cd /d "%~dp0" +start.bat diff --git a/quantumbotx.spec b/quantumbotx.spec new file mode 100644 index 0000000..2fea2b6 --- /dev/null +++ b/quantumbotx.spec @@ -0,0 +1,99 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + +a = Analysis( + ['run.py'], + pathex=['.'], + binaries=[], + datas=[ + ('templates', 'templates'), + ('static', 'static'), + ('core', 'core'), + ('.env.example', '.env.example'), + ('README.md', 'README.md'), + ('MT5_SETUP_GUIDE.md', 'MT5_SETUP_GUIDE.md'), + ], + hiddenimports=[ + 'MetaTrader5', + 'flask', + 'werkzeug', + 'jinja2', + 'numpy', + 'pandas', + 'pandas_ta', + 'core', + 'core.bots', + 'core.brokers', + 'core.data', + 'core.db', + 'core.routes', + 'core.strategies', + 'core.utils', + 'core.ai', + 'core.backtesting', + 'core.education', + 'core.interfaces', + 'core.services', + 'core.seasonal', + 'core.helpers', + 'core.bots.controller', + 'core.bots.trading_bot', + 'core.brokers.base_broker', + 'core.brokers.binance_broker', + 'core.brokers.broker_factory', + 'core.brokers.ctrader_broker', + 'core.brokers.indonesian_brokers', + 'core.brokers.interactive_brokers', + 'core.brokers.tradingview_broker', + 'core.data.chart_data', + 'core.db.connection', + 'core.db.models', + 'core.db.queries', + 'core.ai.ollama_client', + 'core.ai.trading_mentor_ai', + 'core.backtesting.engine', + 'core.backtesting.enhanced_engine', + 'core.education.atr_education', + 'core.utils.mt5', + ], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='QuantumBotX', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + icon=None, +) + +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='QuantumBotX', +) diff --git a/requirements.txt b/requirements.txt index 3b4e637..a22da52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ charset-normalizer==3.4.2 click==8.2.1 colorama==0.4.6 Flask==3.1.1 +gunicorn idna==3.10 itsdangerous==2.2.0 Jinja2==3.1.6 diff --git a/run.py b/run.py index ddb77e5..f42eca2 100644 --- a/run.py +++ b/run.py @@ -29,9 +29,21 @@ app = create_app() @app.route('/api/health') def health_check(): """Endpoint untuk memastikan server berjalan.""" - return jsonify({"status": "ok", "message": "Server is running"}) + mt5_status = "MT5 connected" if mt5.isinitialize() else "MT5 not connected" # pyright: ignore[reportAttributeAccessIssue] + return jsonify({"status": "ok", "message": "Server is running", "mt5": mt5_status}) if __name__ == '__main__': + # Skip MT5 initialization if SKIP_MT5_INIT is set (for Vercel deployment) + if os.getenv('SKIP_MT5_INIT') == '1': + logging.info("Skipping MT5 initialization (deployment mode).") + app.run( + debug=os.getenv('FLASK_DEBUG', 'False').lower() == 'true', + host=os.getenv('FLASK_HOST', '127.0.0.1'), + port=int(os.getenv('FLASK_PORT', 5000)), + use_reloader=False + ) + sys.exit(0) + # --- Inisialisasi MT5 Terpusat --- # Dilakukan di sini untuk memastikan hanya berjalan sekali. try: @@ -72,4 +84,4 @@ if __name__ == '__main__': host=os.getenv('FLASK_HOST', '127.0.0.1'), port=int(os.getenv('FLASK_PORT', 5000)), use_reloader=False - ) \ No newline at end of file + ) diff --git a/setup_quantumbotx.py b/setup_quantumbotx.py new file mode 100644 index 0000000..c0c0cb1 --- /dev/null +++ b/setup_quantumbotx.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +""" +QuantumBotX Setup Script +Automated setup for non-technical users +""" + +import os +import subprocess +from pathlib import Path + +def run_command(command, shell=True): + """Run a command and return the result.""" + try: + result = subprocess.run(command, shell=shell, capture_output=True, text=True) + return result.returncode == 0, result.stdout, result.stderr + except Exception as e: + return False, "", str(e) + +def check_python(): + """Check if Python is installed.""" + success, _, _ = run_command("python --version") + return success + +def install_requirements(): + """Install Python requirements.""" + print("Installing Python dependencies...") + success, stdout, stderr = run_command("pip install -r requirements.txt") + if not success: + print(f"Error installing requirements: {stderr}") + return False + print("ā Python dependencies installed successfully") + return True + +def create_startup_scripts(): + """Create user-friendly startup scripts.""" + print("Creating startup scripts...") + + # Create start.bat + start_bat = '''@echo off +echo Starting QuantumBotX Trading Application... +echo ========================================= +echo. +echo Make sure MetaTrader 5 is running before continuing! +echo. +pause +echo. +python run.py +pause +''' + + with open('start.bat', 'w') as f: + f.write(start_bat) + + # Create start.sh for Unix-like systems (if needed) + start_sh = '''#!/bin/bash +echo "Starting QuantumBotX Trading Application..." +echo "========================================" +echo "" +echo "Make sure MetaTrader 5 is running before continuing!" +echo "" +read -p "Press Enter to continue..." +echo "" +python3 run.py +''' + + with open('start.sh', 'w') as f: + f.write(start_sh) + + # Make start.sh executable on Unix systems + try: + os.chmod('start.sh', 0o755) + except: + pass # Windows doesn't need this + + print("ā Startup scripts created") + return True + +def create_desktop_shortcut(): + """Create desktop shortcut (Windows only).""" + print("Creating desktop shortcut...") + + try: + # Get user's desktop path + desktop = Path.home() / "Desktop" + shortcut_path = desktop / "QuantumBotX.lnk" + + # Create a simple batch file that will be the shortcut target + shortcut_bat = '''@echo off +cd /d "%~dp0" +start.bat +''' + + with open('quantum_botx_shortcut.bat', 'w') as f: + f.write(shortcut_bat) + + print("ā Desktop shortcut script created") + print(f" You can manually create a shortcut to: {os.path.abspath('quantum_botx_shortcut.bat')}") + print(" And place it on your desktop") + + except Exception as e: + print(f"Note: Could not create desktop shortcut automatically: {e}") + print(" You can manually create a shortcut to start.bat on your desktop") + return True + +def create_user_instructions(): + """Create user-friendly instructions.""" + print("Creating user instructions...") + + instructions = '''# QuantumBotX - Quick Start Guide + +## First Time Setup + +1. **Install MetaTrader 5** + - Download from: https://www.metatrader5.com/ + - Install and create a demo account + - Keep MT5 running in the background + +2. **Configure Your Settings** + - Copy `.env.example` to `.env` + - Edit `.env` with your MT5 credentials: + ``` + MT5_LOGIN=your_account_number + MT5_PASSWORD=your_password + MT5_SERVER=your_server_name + ``` + +3. **Start the Application** + - Double-click `start.bat` (Windows) + - Open http://127.0.0.1:5000 in your browser + +## Daily Use + +1. Start MetaTrader 5 first +2. Run `start.bat` +3. Open your web browser to http://127.0.0.1:5000 + +## Troubleshooting + +- Make sure MetaTrader 5 is running +- Check your .env file has correct credentials +- If the app won't start, try running `python run.py` directly + +## Support + +If you need help, check the README.md file or contact support. +''' + + with open('QUICK_START_GUIDE.md', 'w') as f: + f.write(instructions) + + print("ā User instructions created") + return True + +def main(): + """Main setup function.""" + print("QuantumBotX Setup Wizard") + print("========================") + print() + + # Check Python + if not check_python(): + print("ā Python is not installed or not in PATH") + print("Please install Python 3.8 or higher from https://python.org") + input("Press Enter to exit...") + return + + print("ā Python found") + + # Install requirements + if not install_requirements(): + print("ā Failed to install requirements") + input("Press Enter to exit...") + return + + # Create startup scripts + if not create_startup_scripts(): + print("ā Failed to create startup scripts") + input("Press Enter to exit...") + return + + # Create desktop shortcut + create_desktop_shortcut() + + # Create user instructions + if not create_user_instructions(): + print("ā Failed to create user instructions") + input("Press Enter to exit...") + return + + print() + print("š Setup Complete!") + print("==================") + print() + print("Next steps:") + print("1. Install and configure MetaTrader 5") + print("2. Copy .env.example to .env and configure your credentials") + print("3. Run start.bat to launch the application") + print("4. Open http://127.0.0.1:5000 in your browser") + print() + print("See QUICK_START_GUIDE.md for detailed instructions") + print() + input("Press Enter to exit...") + +if __name__ == "__main__": + main() diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..065cd0b --- /dev/null +++ b/start.bat @@ -0,0 +1,10 @@ +@echo off +echo Starting QuantumBotX Trading Application... +echo ========================================= +echo. +echo Make sure MetaTrader 5 is running before continuing! +echo. +pause +echo. +QuantumBotX.exe +pause diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..cf5d78e --- /dev/null +++ b/start.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "Starting QuantumBotX Trading Application..." +echo "========================================" +echo "" +echo "Make sure MetaTrader 5 is running before continuing!" +echo "" +read -p "Press Enter to continue..." +echo "" +python3 run.py diff --git a/static/js/backtesting.js b/static/js/backtesting.js index bfce73e..e0df544 100644 --- a/static/js/backtesting.js +++ b/static/js/backtesting.js @@ -9,7 +9,6 @@ document.addEventListener('DOMContentLoaded', () => { const loadingSpinner = document.getElementById('loading-spinner'); let equityChart = null; // Variabel untuk menyimpan instance grafik const resultsLog = document.getElementById('results-log'); - const downloadBtn = document.getElementById('download-data-btn'); // Muat strategi ke dropdown async function loadStrategies() { @@ -242,43 +241,5 @@ document.addEventListener('DOMContentLoaded', () => { }); } - // Handle data download - downloadBtn.addEventListener('click', async () => { - if (!confirm("This will download historical market data from MT5.\n\nRequirements:\n⢠MT5 Terminal must be running\n⢠MT5 Python library must be available\n⢠Account credentials in .env file\n\nThis may take several minutes. Continue?")) { - return; - } - - const originalText = downloadBtn.innerHTML; - downloadBtn.disabled = true; - downloadBtn.innerHTML = 'Downloading...'; - - try { - const response = await fetch('/api/download-data', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - } - }); - - const result = await response.json(); - - if (response.ok) { - if (result.success) { - alert(`ā Download completed successfully!\n\nDownloaded: ${result.downloaded_files.length} files\nFailed: ${result.failed_count}\n\nFiles saved to 'lab/backtest_data/' directory.`); - } else { - alert(`ā Download failed: ${result.error}`); - } - } else { - alert(`ā Download error: ${result.error}`); - } - } catch (err) { - console.error("Download failed:", err); - alert('ā Failed to connect to server for data download.'); - } finally { - downloadBtn.disabled = false; - downloadBtn.innerHTML = originalText; - } - }); - loadStrategies(); }); diff --git a/static/js/history.js b/static/js/history.js index 0d98951..e08819d 100644 --- a/static/js/history.js +++ b/static/js/history.js @@ -47,18 +47,26 @@ document.addEventListener('DOMContentLoaded', function() { currentSort.direction = 'asc'; } - // Update sort icons - document.getElementById('profit-sort-icon').innerHTML = column === 'profit' ? (currentSort.direction === 'asc' ? 'ā²' : 'ā¼') : ''; - document.getElementById('time-sort-icon').innerHTML = column === 'time' ? (currentSort.direction === 'asc' ? 'ā²' : 'ā¼') : ''; + // Reset all icons + ['symbol', 'type', 'volume', 'profit', 'time', 'magic'].forEach(col => { + const iconEl = document.getElementById(`${col}-sort-icon`); + if (iconEl) { + iconEl.innerHTML = ''; + } + }); + + // Set active icon + const activeIconEl = document.getElementById(`${column}-sort-icon`); + if (activeIconEl) { + activeIconEl.innerHTML = currentSort.direction === 'asc' ? 'ā²' : 'ā¼'; + } const sortedData = [...historyData].sort((a, b) => { let aValue = a[column]; let bValue = b[column]; - if (column === 'profit' || column === 'time') { - aValue = parseFloat(aValue); - bValue = parseFloat(bValue); - } else if (column === 'volume' || column === 'magic') { + // For numeric columns, parse as float + if (['profit', 'time', 'volume', 'magic', 'type'].includes(column)) { aValue = parseFloat(aValue); bValue = parseFloat(bValue); } diff --git a/static/js/i18n.js b/static/js/i18n.js index e21841b..994daaa 100644 --- a/static/js/i18n.js +++ b/static/js/i18n.js @@ -1,3 +1,4 @@ +/* eslint-disable no-dupe-keys */ /** * QuantumBotX Internationalization (i18n) System * Global language support across the entire application @@ -7,17 +8,26 @@ window.QuantumBotXI18n = { translations: { id: { - // Navigation & Common + // Navigation & Common "nav.dashboard": "Dasbor", "nav.bots": "Bot Trading", "nav.backtest": "Backtester", "nav.history": "Riwayat", + "nav.ai_mentor": "AI Mentor", + "nav.strategy_switcher": "Strategy Switcher", + "nav.ramadan": "Ramadan Mode", "nav.settings": "Pengaturan", - "nav.logout": "Keluar", + "nav.portfolio": "Portfolio", + "nav.stocks": "Stocks", + "nav.forex": "Forex", + "nav.notifications": "Notifikasi", + "nav.section.navigation": "Navigasi", + "nav.section.market_data": "Data Pasar", // Dashboard "dashboard.title": "Dasbor QuantumBotX", "dashboard.welcome": "Selamat Datang", + "dashboard.welcome_back": "Selamat datang kembali! Berikut ringkasan trading Anda hari ini.", "dashboard.total_bots": "Total Bot", "dashboard.active_bots": "Bot Aktif", "dashboard.inactive_bots": "Bot Tidak Aktif", @@ -25,6 +35,39 @@ window.QuantumBotXI18n = { "dashboard.today_pnl": "PnL Hari Ini", "dashboard.create_bot": "Buat Bot Baru", "dashboard.view_details": "Lihat Detail", + "dashboard.total_equity": "Total Saldo (Equity)", + "dashboard.today_profit": "Profit Hari Ini", + "dashboard.ai_mentor": "š¤ AI Mentor", + "dashboard.ai_mentor_ready": "Siap Membantu", + "dashboard.ai_mentor_active": "Aktif Menganalisis", + "dashboard.view_analysis": "Lihat Analisis ā", + "dashboard.emotion_status": "Status Emosi", + "dashboard.update_status": "Update Status", + "dashboard.ai_mentor_today": "š§ AI Mentor Hari Ini", + "dashboard.trading_analysis": "Analisis Trading:", + "dashboard.daily_tip": "Tips Hari Ini:", + "dashboard.view_full_report": "š Lihat Laporan Lengkap", + "dashboard.recent_activities": "ā” Aktivitas Terbaru", + "dashboard.loading_activities": "Memuat aktivitas...", + "dashboard.active_trading_bots": "Active Trading Bots", + "dashboard.loading_bot_list": "Memuat daftar bot...", + "dashboard.view_all_bots": "View All Bots", + "dashboard.chat_with_ai_mentor": "Chat dengan AI Mentor", + "dashboard.price_chart": "š Grafik Harga EUR/USD", + "dashboard.loading": "Memuat...", + "dashboard.rsi_chart": "š RSI EUR/USD (H1)", + "dashboard.real_time": "Real-time", + "dashboard.no_active_bots": "Tidak ada bot yang aktif", + "dashboard.emotion_calm": "š Tenang", + "dashboard.emotion_greedy": "š¤ Serakah", + "dashboard.emotion_fear": "š° Takut", + "dashboard.emotion_frustrated": "š¤ Frustasi", + "dashboard.emotion_neutral": "š Netral", + "dashboard.update_emotion_status": "šÆ Update Status Emosi", + "dashboard.cancel": "Batal", + "dashboard.emotion_updated": "Status emosi berhasil diupdate!", + "dashboard.emotion_update_failed": "Gagal update status emosi", + "dashboard.error_updating_emotion": "Error: Gagal update status emosi", // Bot Status "status.active": "Aktif", @@ -39,6 +82,9 @@ window.QuantumBotXI18n = { "action.delete": "Hapus", "action.view": "Lihat", "action.analyze": "Analisis", + "action.start_all": "Start All", + "action.stop_all": "Stop All", + "action.create_new_bot": "Buat Bot Baru", // Form Labels & Messages "label.name": "Nama", @@ -48,12 +94,23 @@ window.QuantumBotXI18n = { "label.profit": "Profit", "label.trades": "Jumlah Trade", "label.win_rate": "Win Rate", + "label.bot_name": "Nama Bot", + "label.risk_per_trade": "Risk per Trade (%)", + "label.sl_atr": "SL (ATR Multiplier)", + "label.tp_atr": "TP (ATR Multiplier)", + "label.timeframe": "Timeframe", + "label.check_interval": "Interval Cek (detik)", + "label.full_name": "Nama Lengkap", + "label.email": "Alamat Email", + "label.password": "Ganti Password (kosongkan jika tidak ingin diubah)", "msg.loading": "Memuat...", "msg.no_data": "Tidak ada data", "msg.success": "Berhasil", "msg.error": "Error", "msg.confirm": "Apakah Anda yakin?", + "msg.save_changes": "Simpan Perubahan", + "msg.save_preferences": "Simpan Preferensi", // Time & Date "time.today": "Hari Ini", @@ -65,11 +122,247 @@ window.QuantumBotXI18n = { "error.connection": "Gagal terhubung ke server", "error.loading": "Gagal memuat data", "error.save": "Gagal menyimpan perubahan", + "error.404_title": "Halaman Tidak Ditemukan - QuantumBotX", + "error.404_heading": "Halaman Tidak Ditemukan", + "error.404_message": "Maaf, halaman yang Anda cari tidak ada atau telah dipindahkan.", + "error.500_title": "Terjadi Kesalahan Internal - QuantumBotX", + "error.500_heading": "Terjadi Kesalahan Internal", + "error.500_message": "Maaf, terjadi masalah pada server kami. Tim kami telah diberitahu dan sedang menanganinya.", + "error.back_to_dashboard": "Kembali ke Dashboard", // AI Mentor "mentor.greeting": "Halo, Teman Trader!", "mentor.welcome": "Selamat datang di sistem trading AI saya", + // AI Mentor (Consolidated - removed duplications) + "ai_mentor.title": "š§ AI Mentor Trading - QuantumBotX", + "ai_mentor.page_title": "š§ AI Mentor Trading - QuantumBotX", + "ai_mentor.header": "š§ AI Mentor Trading Indonesia", + "ai_mentor.subtitle": "Mentor digital Anda untuk sukses trading jangka panjang", + "ai_mentor.language": "š®š© Bahasa Indonesia", + "ai_mentor.realtime": "š Analisis Real-time", + "ai_mentor.personal": "šÆ Personal", + "ai_mentor.total_sessions": "Total Sesi", + "ai_mentor.win_rate": "Win Rate", + "ai_mentor.today": "Hari Ini", + "ai_mentor.not_traded": "belum trading", + "ai_mentor.ai_status": "Status AI", + "ai_mentor.ai_active": "š¤ Aktif", + "ai_mentor.ai_ready": "siap menganalisis", + "ai_mentor.today_trading": "š Trading Hari Ini", + "ai_mentor.total_trades": "Total Trades:", + "ai_mentor.pnl": "P&L:", + "ai_mentor.emotion": "Emosi:", + "ai_mentor.your_notes": "Catatan Anda:", + "ai_mentor.view_full_analysis": "š§ Lihat Analisis AI Lengkap", + "ai_mentor.update_emotion": "āļø Update Emosi & Catatan", + "ai_mentor.not_traded_today": "Belum Ada Trading Hari Ini", + "ai_mentor.start_trading": "Mulai trading untuk mendapatkan analisis AI yang personal!", + "ai_mentor.record_emotion": "š Catat Emosi Trading", + "ai_mentor.ai_insights": "š¤ AI Insights Terbaru", + "ai_mentor.no_insights": "AI Siap Membantu!", + "ai_mentor.start_trading_insights": "Mulai trading untuk mendapatkan insight personal dari AI mentor Anda.", + "ai_mentor.view_history": "š Lihat Semua Riwayat", + "ai_mentor.daily_tips": "š” Tips Harian dari AI Mentor", + "ai_mentor.consistency": "šÆ Konsistensi", + "ai_mentor.consistency_tip": "Profit kecil tapi konsisten lebih baik daripada profit besar sekali terus loss.", + "ai_mentor.risk_management": "š”ļø Risk Management", + "ai_mentor.risk_management_tip": "Jangan pernah risiko lebih dari 2% modal per trade. Modal adalah nyawa trader!", + "ai_mentor.emotion": "š§ Emosi", + "ai_mentor.emotion_tip": "Trading dengan emosi tenang adalah kunci trader profesional. Istirahat jika frustasi.", + "ai_mentor.chat_with_mentor": "š¬ Chat dengan AI Mentor", + "ai_mentor.developing": "Fitur sedang dikembangkan...", + "ai_mentor.use_dashboard": "Sementara ini, gunakan dashboard untuk melihat analisis AI.", + "ai_mentor.history_page_title": "š Riwayat AI Mentor - QuantumBotX", + "ai_mentor.report_page_title": "š Laporan AI Mentor - QuantumBotX", + "ai_mentor.session_detail_title": "š Detail Sesi {{ session_date }} - AI Mentor - QuantumBotX", + "ai_mentor.holiday_risk_reduction": "ā ļø Risk otomatis dikurangi {{ (100 - holiday_config.adjustments.risk_reduction * 100)|int }}% untuk periode liburan", + "ai_mentor.holiday": "⢠{{ holiday_config.active_holiday.split()[0] }} š", + "ai_mentor.language_indonesian": "š®š© Bahasa Indonesia", + "ai_mentor.realtime_analysis": "š Analisis Real-time", + "ai_mentor.sessions": "sesi trading", + "ai_mentor.profit_sessions": "sesi profit", + "ai_mentor.no_trading": "belum trading", + "ai_mentor.ai_status": "Status AI", + "ai_mentor.ai_active": "š¤ Aktif", + "ai_mentor.ready_to_analyze": "siap menganalisis", + "ai_mentor.todays_trading": "Trading Hari Ini", + "ai_mentor.view_full_analysis": "š§ Lihat Analisis AI Lengkap", + "ai_mentor.update_emotion": "āļø Update Emosi & Catatan", + "ai_mentor.record_emotion": "š Catat Emosi Trading", + "ai_mentor.latest_insights": "AI Insights Terbaru", + "ai_mentor.view_all_history": "š Lihat Semua Riwayat", + "ai_mentor.ai_ready": "AI Siap Membantu!", + "ai_mentor.start_trading_for_insights": "Mulai trading untuk mendapatkan insight personal dari AI mentor Anda.", + "ai_mentor.daily_tips": "Tips Harian dari AI Mentor", + "ai_mentor.consistency": "šÆ Konsistensi", + "ai_mentor.consistency_tip": "Profit kecil tapi konsisten lebih baik daripada profit besar sekali terus loss.", + "ai_mentor.risk_management": "š”ļø Risk Management", + "ai_mentor.risk_management_tip": "Jangan pernah risiko lebih dari 2% modal per trade. Modal adalah nyawa trader!", + "ai_mentor.emotion": "š§ Emosi", + "ai_mentor.emotion_tip": "Trading dengan emosi tenang adalah kunci trader profesional. Istirahat jika frustasi.", + "ai_mentor.chat_with_mentor": "š¬ Chat dengan AI Mentor", + "ai_mentor.feature_development": "Fitur sedang dikembangkan...", + "ai_mentor.use_dashboard": "Sementara ini, gunakan dashboard untuk melihat analisis AI.", + "ai_mentor.report_title": "š Laporan AI Mentor", + "ai_mentor.report_subtitle": "Analisis personal untuk {{ session_data.session_date if session_data else 'Hari Ini' }}", + "ai_mentor.created_by_ai": "š¤ Dibuat oleh AI", + "ai_mentor.real_data": "š Data Real", + "ai_mentor.trades": "trades", + "ai_mentor.no_data": "No data", + "ai_mentor.back_to_dashboard": "Kembali ke Dashboard", + "ai_mentor.report_history": "Riwayat Laporan", + "ai_mentor.trading_summary": "Ringkasan Trading", + "ai_mentor.profit_loss": "Profit/Loss", + "ai_mentor.emotional_condition": "Kondisi Emosi", + "ai_mentor.market_conditions": "Kondisi Market", + "ai_mentor.trading_patterns": "Analisis Pola Trading", + "ai_mentor.main_pattern": "Pola Utama:", + "ai_mentor.strength": "Kekuatan:", + "ai_mentor.improvement_areas": "Area Perbaikan:", + "ai_mentor.emotional_analysis": "Analisis Emosi vs Performa", + "ai_mentor.emotional_feedback": "Feedback Emosi:", + "ai_mentor.tip": "Tip:", + "ai_mentor.risk_management_analysis": "Evaluasi Manajemen Risiko", + "ai_mentor.recommendations": "Rekomendasi AI Mentor", + "ai_mentor.motivational_message": "Pesan Motivasi", + "ai_mentor.trade_details": "Detail Trades Hari Ini", + "ai_mentor.lot_size": "Lot: {{ trade.lot_size }}", + "ai_mentor.sl": "SL: {{ 'ā ' if trade.stop_loss_used else 'ā' }}", + "ai_mentor.tp": "TP: {{ 'ā ' if trade.take_profit_used else 'ā' }}", + "ai_mentor.personal_notes": "Catatan Pribadi Anda", + "ai_mentor.no_trading_data": "Belum Ada Data Trading", + "ai_mentor.back_to_dashboard_button": "Kembali ke Dashboard", + "ai_mentor.full_report": "Laporan AI Lengkap", + "ai_mentor.view_full_report": "Lihat Laporan Lengkap", + "ai_mentor.history_title": "š Riwayat AI Mentor Trading", + "ai_mentor.history_subtitle": "Analisis lengkap perjalanan trading Anda dengan bantuan AI Indonesia", + "ai_mentor.performance_analysis": "š Analisis Performa", + "ai_mentor.ai_insights": "š§ AI Insights", + "ai_mentor.total_reports": "Total Laporan", + "ai_mentor.sessions_analyzed": "sesi dianalisis", + "ai_mentor.period": "Periode", + "ai_mentor.days": "hari", + "ai_mentor.last_history": "riwayat terakhir", + "ai_mentor.performance": "Performa", + "ai_mentor.total_pnl": "total P&L", + "ai_mentor.profit_sessions": "sesi profit", + "ai_mentor.period_filter": "Filter Periode", + "ai_mentor.filter_7_days": "7 Hari", + "ai_mentor.filter_30_days": "30 Hari", + "ai_mentor.filter_90_days": "90 Hari", + "ai_mentor.filter_1_year": "1 Tahun", + "ai_mentor.trading_session": "Sesi Trading", + "ai_mentor.ai_summary": "š¤ AI Summary:", + "ai_mentor.market": "Market", + "ai_mentor.view_details": "Lihat Detail ā", + "ai_mentor.load_more": "Muat Lebih Banyak", + "ai_mentor.no_history": "Belum Ada Riwayat Trading", + "ai_mentor.start_trading_for_history": "Mulai trading untuk mendapatkan analisis AI dan saran personal dari mentor digital Anda.", + "ai_mentor.start_trading_session": "Mulai Trading Session", + "ai_mentor.view_trading_bots": "Lihat Trading Bots", + "ai_mentor.how_are_you_feeling": "š§ Bagaimana perasaan Anda saat trading hari ini?", + "ai_mentor.emotion_calm": "š Tenang", + "ai_mentor.calm_description": "Pikiran jernih, tidak terburu-buru", + "ai_mentor.emotion_greedy": "š¤ Serakah", + "ai_mentor.greedy_description": "Ingin profit besar, agresif", + "ai_mentor.emotion_fearful": "š° Takut", + "ai_mentor.fearful_description": "Khawatir loss, ragu-ragu", + "ai_mentor.emotion_frustrated": "š¤ Frustasi", + "ai_mentor.frustrated_description": "Kesal karena loss beruntun", + "ai_mentor.today_pnl": "š° P&L Hari Ini (USD)", + "ai_mentor.pnl_placeholder": "Contoh: 25.50 atau -15.30", + "ai_mentor.today_notes": "š Catatan Trading Hari Ini", + "ai_mentor.notes_placeholder": "Contoh: Hari ini fokus EURUSD, pakai SL ketat. Market agak volatile karena berita NFP...", + "ai_mentor.instant_feedback": "ā” Feedback Instan", + "ai_mentor.save_data": "š¾ Simpan Data", + "ai_mentor.ai_feedback": "š¤ Feedback AI Mentor:", + "ai_mentor.analyzing": "š¤ AI sedang menganalisis trading Anda...", + "ai_mentor.emotional_analysis": "š§ Analisis Emosi:", + "ai_mentor.motivation": "šŖ Motivasi:", + "ai_mentor.quick_tips": "š” Tips Cepat:", + "ai_mentor.failed_feedback": "ā Gagal mendapatkan feedback. Silakan coba lagi.", + "ai_mentor.session_trading_detail": "š Detail Sesi Trading", + "ai_mentor.full_analysis": "Analisis lengkap dari AI Mentor Indonesia", + "ai_mentor.ai_analysis": "š®š© AI Analysis", + "ai_mentor.personal_insights": "š§ Personal Insights", + "ai_mentor.performance_review": "š Performance Review", + "ai_mentor.total_pnl": "Total P&L", + "ai_mentor.total_trades": "Total Trades", + "ai_mentor.emotional_state": "Emotional State", + "ai_mentor.trading_summary": "š Ringkasan Trading", + "ai_mentor.market_context": "š Konteks Pasar", + "ai_mentor.market_conditions": "Kondisi Pasar", + "ai_mentor.personal_notes": "š Catatan Pribadi Anda", + "ai_mentor.ai_mentor_report": "š¤ Laporan AI Mentor", + "ai_mentor.emotional_analysis_vs_performance": "š Analisis Emosi vs Performa", + "ai_mentor.emotional_status": "Status Emosi: {{ session_data.emotions|title if session_data.emotions else 'Tidak Tercatat' }}", + "ai_mentor.emotional_advice": "š” Saran Emosional", + "ai_mentor.ai_recommendations": "šÆ Rekomendasi AI", + "ai_mentor.motivation_inspiration": "š Motivasi & Inspirasi", + "ai_mentor.learning_points": "š Poin Pembelajaran", + "ai_mentor.back_to_history": "Kembali ke Riwayat", + "ai_mentor.back_to_history_button": "ā Kembali ke Riwayat", + "ai_mentor.ai_mentor_dashboard": "Dashboard AI Mentor", + "ai_mentor.reanalyze": "š Analisis Ulang", + "ai_mentor.session_detail_title": "š Detail Sesi {{ session_date }} - AI Mentor - QuantumBotX", + "ai_mentor.settings_title": "āļø Pengaturan AI Mentor", + "ai_mentor.settings_subtitle": "Kustomisasi pengalaman AI Trading Mentor sesuai preferensi Anda", + "ai_mentor.indonesia_setup": "š®š© Indonesia Setup", + "ai_mentor.realtime_config": "ā” Real-time Config", + "ai_mentor.personal": "šÆ Personal", + "ai_mentor.language_regional": "š Bahasa & Regional", + "ai_mentor.interface_language": "Bahasa Interface", + "ai_mentor.language_choice": "Pilih bahasa untuk AI Mentor", + "ai_mentor.timezone": "Zona Waktu", + "ai_mentor.timezone_description": "Zona waktu untuk analisis trading", + "ai_mentor.timezone_wib": "WIB (UTC+7) - Jakarta Time", + "ai_mentor.currency_format": "Format Mata Uang", + "ai_mentor.currency_display": "Format tampilan profit/loss", + "ai_mentor.ai_behavior": "š§ Perilaku AI Mentor", + "ai_mentor.automatic_analysis": "Analisis Otomatis", + "ai_mentor.automatic_analysis_description": "AI menganalisis setiap sesi trading secara otomatis", + "ai_mentor.emotional_feedback": "Feedback Emosional", + "ai_mentor.emotional_feedback_description": "AI memberikan feedback berdasarkan kondisi emosi", + "ai_mentor.daily_motivation": "Motivasi Harian", + "ai_mentor.daily_motivation_description": "Terima pesan motivasi setiap hari", + "ai_mentor.analysis_detail_level": "Level Detail Analisis", + "ai_mentor.analysis_detail_description": "Tingkat detail feedback AI", + "ai_mentor.basic": "Basic", + "ai_mentor.detailed": "Detailed", + "ai_mentor.expert": "Expert", + "ai_mentor.notifications": "š Notifikasi", + "ai_mentor.daily_report": "Laporan Harian", + "ai_mentor.daily_report_time": "Waktu pengiriman laporan AI harian", + "ai_mentor.timezone_wib_short": "WIB", + "ai_mentor.trading_reminder": "Reminder Trading", + "ai_mentor.trading_reminder_description": "Pengingat untuk input emosi dan catatan", + "ai_mentor.overtrading_alert": "Alert Overtrading", + "ai_mentor.overtrading_alert_description": "Peringatan jika terlalu banyak trading", + "ai_mentor.cultural_preferences": "š Preferensi Budaya", + "ai_mentor.automatic_holiday_mode": "Mode Liburan Otomatis", + "ai_mentor.automatic_holiday_mode_description": "Aktivkan mode Ramadan dan Natal secara otomatis", + "ai_mentor.ramadan_risk_adjustment": "Penyesuaian Risk Ramadan", + "ai_mentor.ramadan_risk_adjustment_description": "Kurangi risk otomatis selama bulan Ramadan", + "ai_mentor.sahur_iftar_pause": "Pause Trading Sahur/Iftar", + "ai_mentor.sahur_iftar_pause_description": "Hentikan trading otomatis saat waktu sahur dan iftar", + "ai_mentor.data_privacy": "š Data & Privacy", + "ai_mentor.save_ai_history": "Simpan Riwayat AI", + "ai_mentor.save_ai_history_description": "Berapa lama menyimpan analisis AI", + "ai_mentor.30_days": "30 Hari", + "ai_mentor.90_days": "90 Hari", + "ai_mentor.1_year": "1 Tahun", + "ai_mentor.unlimited": "Unlimited", + "ai_mentor.export_data": "Export Data", + "ai_mentor.export_data_description": "Download semua data AI Mentor Anda", + "ai_mentor.export": "š„ Export", + "ai_mentor.reset_all_data": "Reset Semua Data", + "ai_mentor.reset_all_data_description": "ā ļø Hapus semua riwayat dan analisis AI", + "ai_mentor.reset": "šļø Reset", + "ai_mentor.save_settings": "š¾ Simpan Pengaturan", + "ai_mentor.reset_to_defaults": "š Reset ke Default", + "ai_mentor.back_to_dashboard": "ā Kembali ke Dashboard", + // Units & Currencies "currency.usd": "USD", "currency.idr": "IDR", @@ -79,8 +372,237 @@ window.QuantumBotXI18n = { "settings.title": "Pengaturan", "settings.language": "Bahasa", "settings.theme": "Tema", - "settings.save": "Simpan Perubahan" + "settings.save": "Simpan Perubahan", + "settings.profile": "Profil", + "settings.preferences": "Preferensi", + "settings.api_keys": "API Keys Bursa", + "settings.quick_settings": "Pengaturan Cepat", + "settings.email_notifications": "Notifikasi Email", + "settings.auto_update": "Update Otomatis Strategi", + "settings.demo_mode": "Mode Demo", + "settings.version": "Versi", + "settings.last_updated": "Terakhir Update", + "settings.light": "Terang", + "settings.dark": "Gelap (Segera Hadir)", + "settings.indonesian": "Indonesia", + "settings.english": "English", + "settings.api_info": "API Keys akan digunakan oleh versi QuantumBotX berikutnya untuk mengakses broker non-MT5.", + "settings.api_placeholder": "Fitur ini akan tersedia di QuantumBotX API versi mendatang.", + // Trading Bots + "bots.title": "Trading Bots", + "bots.manage": "Kelola semua bot dan strategi Anda.", + "bots.start_all_title": "Jalankan semua bot yang dijeda", + "bots.stop_all_title": "Hentikan semua bot yang aktif", + "bots.name_market": "Nama / Pasar", + "bots.parameters": "Parameter", + "bots.configuration": "Konfigurasi", + "bots.actions": "Aksi", + "bots.create_edit_modal": "Modal untuk Membuat/Mengedit Bot", + "bots.create_new": "š Buat Bot Baru", + "bots.close_modal": "Tutup modal", + "bots.row_name_market": "Baris 1: Nama & Pasar", + "bots.row_lot_sl_tp": "Baris 2: Lot, SL, TP", + "bots.row_timeframe_interval": "Baris 3: Timeframe & Interval", + "bots.enable_strategy_switching": "Aktifkan Automatic Strategy Switching", + "bots.strategy_switching_info": "Jika diaktifkan, bot akan secara otomatis beralih ke strategi terbaik berdasarkan kinerja terkini.", + "bots.row_strategy_params": "Baris 4: Strategi & Parameternya", + "bots.strategy_params_loaded": "Parameter strategi akan dimuat di sini oleh JavaScript", + "bots.create_bot": "Buat Bot", + "bots.cancel": "Batal", + "bots.example_name": "Contoh: XAUUSD Hybrid H1", + "bots.example_market": "Contoh: XAUUSD atau EURUSD", + "bots.timeframe_1m": "1 Menit", + "bots.timeframe_5m": "5 Menit", + "bots.timeframe_15m": "15 Menit", + "bots.timeframe_30m": "30 Menit", + "bots.timeframe_1h": "1 Jam", + "bots.timeframe_4h": "4 Jam", + "bots.timeframe_1d": "1 Hari", + "bots.select_strategy": "Pilih sebuah strategi", + "bots.detail_title": "Detail Bot - QuantumBotX", + + // Profile + "profile.title": "Profil", + "profile.my_profile": "Profil Saya", + "profile.loading": "Memuat...", + "profile.joined_since": "Bergabung sejak: Juli 2025", + "profile.save_changes": "Simpan Perubahan", + "profile.password_placeholder": "ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢", + + // Holidays + "holiday.countdown.iftar": "ā±ļø Hitung Mundur Iftar", + "holiday.countdown.christmas": "š Hitung Mundur Natal", + "holiday.countdown.new_year": "š Hitung Mundur Tahun Baru", + "holiday.countdown.days_until": "hari lagi sampai", + "holiday.patience_reminder": "š§āāļø Pengingat Kesabaran", + "holiday.risk_adjustment": "š”ļø Penyesuaian Risiko", + "holiday.risk_reduction": "Pengurangan risiko otomatis", + "holiday.optimal_trading_hours": "ā° Waktu Trading Optimal", + "holiday.christmas_greeting": "⨠Salam Natal", + "holiday.lot_adjustment": "š Penyesuaian Lot", + "holiday.lot_reduction": "Pengurangan ukuran lot", + "holiday.new_year_resolution": "šÆ Resolusi Trading", + "holiday.new_year_goal_setting": "Waktu yang tepat untuk menetapkan tujuan trading tahun ini", + + // Backtesting + "backtest.enhanced_engine_active": "š Enhanced Backtesting Engine Active", + "backtest.includes": "Your backtesting now includes:", + "backtest.realistic_spread": "Realistic spread costs", + "backtest.actual_costs": "Actual trading costs deducted", + "backtest.atr_risk": "ATR-based risk management", + "backtest.dynamic_sizing": "Dynamic position sizing", + "backtest.instrument_protection": "Instrument protection", + "backtest.gold_safeguards": "Gold trading safeguards", + "backtest.slippage": "Slippage simulation", + "backtest.accurate_modeling": "More accurate execution modeling", + "backtest.upload_data": "Unggah Data Historis (CSV)", + "backtest.enhanced": "š Enhanced", + "backtest.dynamic_sl": "Dynamic SL based on volatility", + "backtest.dynamic_tp": "Dynamic TP based on volatility", + "backtest.run": "Jalankan Backtest", + "backtest.results": "Hasil Backtest", + "backtest.history_title": "Riwayat Backtest - QuantumBotX", + "backtest.running": "Menjalankan simulasi...", + + // History + "history.title": "Riwayat Transaksi Global", + "history.description": "Semua transaksi yang telah ditutup dari akun MetaTrader 5.", + "history.symbol": "Simbol", + "history.type": "Tipe", + "history.volume": "Volume", + "history.profit": "Profit", + "history.close_time": "Waktu Penutupan", + "history.magic": "Magic Number", + "history.loading": "Memuat riwayat...", + + // Portfolio + "portfolio.title": "Portfolio Real-Time", + "portfolio.description": "Posisi trading yang sedang terbuka di akun MetaTrader 5.", + "portfolio.pnl_chart": "Grafik Profit/Loss Terbuka (Real-Time)", + "portfolio.allocation_chart": "Alokasi Aset", + "portfolio.symbol": "Simbol", + "portfolio.type": "Tipe", + "portfolio.volume": "Volume", + "portfolio.open_price": "Harga Buka", + "portfolio.profit_loss": "Profit/Loss", + "portfolio.magic": "Magic Number", + "portfolio.loading": "Memuat posisi terbuka...", + "portfolio.open_pnl_total": "Total P/L Terbuka", + "portfolio.no_open_positions": "Belum ada posisi terbuka.", + + // Market Data + "market.forex_title": "Pasar Forex", + "market.forex_description": "Data harga real-time dari pasar valuta asing.", + "market.stocks_title": "Pasar Saham", + "market.stocks_description": "Data harga real-time dari pasar saham global.", + "market.pair": "Pasangan", + "market.bid_price": "Harga Bid", + "market.ask_price": "Harga Ask", + "market.spread": "Spread", + "market.stock": "Saham", + "market.price": "Harga", + "market.change_24h": "Perubahan 24j", + "market.time": "Waktu", + "market.loading": "Memuat data...", + "market.close": "Close", + + // Strategy Switcher + "strategy_switcher.title": "Dasbor Strategy Switcher", + "strategy_switcher.header": "š Automatic Strategy Switcher", + "strategy_switcher.subtitle": "Pemantauan real-time dan analitik performa untuk pengalihan strategi otomatis", + "strategy_switcher.current_status": "Status Saat Ini", + "strategy_switcher.manual_evaluate": "Evaluasi Manual", + "strategy_switcher.loading": "Memuat...", + "strategy_switcher.cooldown_active": "Cooldown Aktif", + "strategy_switcher.active": "Aktif", + "strategy_switcher.active_strategy": "Strategi Aktif", + "strategy_switcher.active_symbol": "Simbol Aktif", + "strategy_switcher.last_switch": "Peralihan Terakhir", + "strategy_switcher.never": "Tidak Pernah", + "strategy_switcher.performance_rankings": "š Peringkat Performa Strategi", + "strategy_switcher.refresh_rankings": "Segarkan Peringkat", + "strategy_switcher.rank": "Peringkat", + "strategy_switcher.strategy_symbol": "Strategi/Simbol", + "strategy_switcher.composite_score": "Skor Komposit", + "strategy_switcher.profitability": "Profitabilitas", + "strategy_switcher.risk_control": "Kontrol Risiko", + "strategy_switcher.market_fit": "Kesesuaian Pasar", + "strategy_switcher.no_rankings": "Tidak ada peringkat strategi yang tersedia", + "strategy_switcher.recent_switches": "ā” Peralihan Strategi Terbaru", + "strategy_switcher.refresh_switches": "Segarkan Peralihan", + "strategy_switcher.no_switches": "Belum ada peralihan strategi yang dicatat.", + "strategy_switcher.monitored_instruments": "š Instrumen & Strategi yang Dipantau", + "strategy_switcher.instruments": "Instrumen", + "strategy_switcher.strategies": "Strategi", + "strategy_switcher.none": "Tidak Ada", + "strategy_switcher.switch_from": "Beralih dari", + "strategy_switcher.switch_to": "ke", + "strategy_switcher.initialized_with": "Diinisialisasi dengan", + "strategy_switcher.manual_trigger_confirm": "Apakah Anda yakin ingin memicu evaluasi strategi secara manual?", + "strategy_switcher.loading_strategy_rankings": "Memuat peringkat strategi...", + "strategy_switcher.loading_recent_switches": "Memuat peralihan terbaru...", + "strategy_switcher.monitored_instruments_strategies": "š Instrumen & Strategi yang Dipantau", + "strategy_switcher.score": "Skor:", + "strategy_switcher.no_strategy_rankings": "Tidak ada peringkat strategi yang tersedia", + "strategy_switcher.switched_from": "Beralih dari", + "strategy_switcher.switched_to": "ke", + "strategy_switcher.no_strategy_switches": "Belum ada peralihan strategi yang dicatat.", + "strategy_switcher.strategy_performance_rankings": "š Peringkat Performa Strategi", + "strategy_switcher.recent_strategy_switches": "ā” Peralihan Strategi Terbaru", + + // Ramadan + "ramadan.title": "Ramadan Trading Mode", + "ramadan.page_title": "š Ramadan Trading Mode - QuantumBotX", + "ramadan.header": "š Ramadan Trading Mode", + "ramadan.subtitle": "Bulan suci dengan fitur trading yang menghormati ibadah puasa", + "ramadan.info": "Mode ini aktif secara otomatis selama bulan Ramadan dan akan menyesuaikan pengaturan trading Anda untuk menghormati waktu ibadah. Anda tidak perlu mengaktifkannya secara manual.", + "ramadan.status": "Status Ramadan", + "ramadan.period": "Periode Ramadan", + "ramadan.greeting": "Salam Ramadan", + "ramadan.iftar_countdown": "ā±ļø Hitung Mundur Iftar", + "ramadan.hours": "Jam", + "ramadan.minutes": "Menit", + "ramadan.until": "Sampai", + "ramadan.trading_adjustments": "āļø Penyesuaian Trading", + "ramadan.fasting_times": "Waktu Istirahat Puasa", + "ramadan.suhoor": "Sahur", + "ramadan.suhoor_time": "03:30 - 05:00 WIB", + "ramadan.iftar_time": "Iftar", + "ramadan.iftar_time_range": "18:00 - 19:30 WIB", + "ramadan.tarawih": "Tarawih", + "ramadan.tarawih_time": "20:00 - 21:30 WIB", + "ramadan.risk_adjustments": "Penyesuaian Risiko", + "ramadan.reduced_risk_mode": "Reduced Risk Mode", + "ramadan.reduced_risk_description": "20% pengurangan risiko selama puasa", + "ramadan.patience_mode": "Patience Mode", + "ramadan.patience_mode_description": "Fokus pada kualitas bukan kuantitas", + "ramadan.optimal_hours": "Optimal Hours", + "ramadan.optimal_hours_time": "22:00 - 03:00 WIB", + "ramadan.zakat_calculator": "š° Kalkulator Zakat Trading", + "ramadan.zakat_information": "Informasi Zakat", + "ramadan.gold_nisab": "Nisab Emas", + "ramadan.silver_nisab": "Nisab Perak", + "ramadan.zakat_percentage": "Persentase Zakat", + "ramadan.zakat_reminder": "Pengingat Zakat", + "ramadan.zakat_trading_reminder": "Zakat perdagangan: 2.5% dari profit trading selama 1 tahun hijriah. Jangan lupa menghitung zakat dari profit trading Anda selama Ramadan.", + "ramadan.patience_reminder": "š§āāļø Pengingat Kesabaran", + "ramadan.loading": "Loading...", + "ramadan.active": "Aktif", + "ramadan.inactive": "Tidak Aktif", + "ramadan.not_ramadan": "Bukan periode Ramadan", + "ramadan.default_greeting": "Saatnya berpuasa, saatnya trading dengan berkah", + + // Other + "common.close": "Tutup", + "common.yes": "Ya", + "common.no": "Tidak", + + // Notifications + "notifications.loading": "Memuat notifikasi...", + + // AI Mentor Settings + "ai_mentor.settings_title": "āļø Pengaturan AI Mentor - QuantumBotX" }, en: { // Navigation & Common @@ -88,12 +610,21 @@ window.QuantumBotXI18n = { "nav.bots": "Trading Bots", "nav.backtest": "Backtester", "nav.history": "History", + "nav.ai_mentor": "AI Mentor", + "nav.strategy_switcher": "Strategy Switcher", + "nav.ramadan": "Ramadan Mode", "nav.settings": "Settings", - "nav.logout": "Logout", + "nav.portfolio": "Portfolio", + "nav.stocks": "Stocks", + "nav.forex": "Forex", + "nav.notifications": "Notifications", + "nav.section.navigation": "Navigation", + "nav.section.market_data": "Market Data", // Dashboard "dashboard.title": "QuantumBotX Dashboard", "dashboard.welcome": "Welcome", + "dashboard.welcome_back": "Welcome back! Here's your trading summary for today.", "dashboard.total_bots": "Total Bots", "dashboard.active_bots": "Active Bots", "dashboard.inactive_bots": "Inactive Bots", @@ -101,6 +632,39 @@ window.QuantumBotXI18n = { "dashboard.today_pnl": "Today's P&L", "dashboard.create_bot": "Create New Bot", "dashboard.view_details": "View Details", + "dashboard.total_equity": "Total Balance (Equity)", + "dashboard.today_profit": "Today's Profit", + "dashboard.ai_mentor": "š¤ AI Mentor", + "dashboard.ai_mentor_ready": "Ready to Help", + "dashboard.ai_mentor_active": "Actively Analyzing", + "dashboard.view_analysis": "View Analysis ā", + "dashboard.emotion_status": "Emotion Status", + "dashboard.update_status": "Update Status", + "dashboard.ai_mentor_today": "š§ AI Mentor Today", + "dashboard.trading_analysis": "Trading Analysis:", + "dashboard.daily_tip": "Daily Tip:", + "dashboard.view_full_report": "š View Full Report", + "dashboard.recent_activities": "ā” Recent Activities", + "dashboard.loading_activities": "Loading activities...", + "dashboard.active_trading_bots": "Active Trading Bots", + "dashboard.loading_bot_list": "Loading bot list...", + "dashboard.view_all_bots": "View All Bots", + "dashboard.chat_with_ai_mentor": "Chat with AI Mentor", + "dashboard.price_chart": "š EUR/USD Price Chart", + "dashboard.loading": "Loading...", + "dashboard.rsi_chart": "š EUR/USD RSI (H1)", + "dashboard.real_time": "Real-time", + "dashboard.no_active_bots": "No active bots", + "dashboard.emotion_calm": "š Calm", + "dashboard.emotion_greedy": "š¤ Greedy", + "dashboard.emotion_fear": "š° Fear", + "dashboard.emotion_frustrated": "š¤ Frustrated", + "dashboard.emotion_neutral": "š Neutral", + "dashboard.update_emotion_status": "šÆ Update Emotion Status", + "dashboard.cancel": "Cancel", + "dashboard.emotion_updated": "Emotion status updated successfully!", + "dashboard.emotion_update_failed": "Failed to update emotion status", + "dashboard.error_updating_emotion": "Error: Failed to update emotion status", // Bot Status "status.active": "Active", @@ -115,6 +679,9 @@ window.QuantumBotXI18n = { "action.delete": "Delete", "action.view": "View", "action.analyze": "Analyze", + "action.start_all": "Start All", + "action.stop_all": "Stop All", + "action.create_new_bot": "Create New Bot", // Form Labels & Messages "label.name": "Name", @@ -124,12 +691,23 @@ window.QuantumBotXI18n = { "label.profit": "Profit", "label.trades": "Trades", "label.win_rate": "Win Rate", + "label.bot_name": "Bot Name", + "label.risk_per_trade": "Risk per Trade (%)", + "label.sl_atr": "SL (ATR Multiplier)", + "label.tp_atr": "TP (ATR Multiplier)", + "label.timeframe": "Timeframe", + "label.check_interval": "Check Interval (seconds)", + "label.full_name": "Full Name", + "label.email": "Email Address", + "label.password": "Change Password (leave blank if you don't want to change it)", "msg.loading": "Loading...", "msg.no_data": "No data available", "msg.success": "Success", "msg.error": "Error", "msg.confirm": "Are you sure?", + "msg.save_changes": "Save Changes", + "msg.save_preferences": "Save Preferences", // Time & Date "time.today": "Today", @@ -141,11 +719,247 @@ window.QuantumBotXI18n = { "error.connection": "Failed to connect to server", "error.loading": "Failed to load data", "error.save": "Failed to save changes", + "error.404_title": "Page Not Found - QuantumBotX", + "error.404_heading": "Page Not Found", + "error.404_message": "Sorry, the page you're looking for doesn't exist or has been moved.", + "error.500_title": "Internal Server Error - QuantumBotX", + "error.500_heading": "Internal Server Error", + "error.500_message": "Sorry, there was a problem with our server. Our team has been notified and is working on it.", + "error.back_to_dashboard": "Back to Dashboard", // AI Mentor "mentor.greeting": "Hello, Trading Friend!", "mentor.welcome": "Welcome to my AI trading system", + // AI Mentor (Consolidated - no duplicates) + "ai_mentor.title": "š§ AI Trading Mentor - QuantumBotX", + "ai_mentor.page_title": "š§ AI Mentor Trading - QuantumBotX", + "ai_mentor.header": "š§ AI Trading Mentor", + "ai_mentor.subtitle": "Your digital mentor for long-term trading success", + "ai_mentor.language": "šŗšø English Language", + "ai_mentor.realtime": "š Real-time Analysis", + "ai_mentor.personal": "šÆ Personal", + "ai_mentor.total_sessions": "Total Sessions", + "ai_mentor.win_rate": "Win Rate", + "ai_mentor.today": "Today", + "ai_mentor.not_traded": "not traded yet", + "ai_mentor.ai_status": "AI Status", + "ai_mentor.ai_active": "š¤ Active", + "ai_mentor.ai_ready": "ready to analyze", + "ai_mentor.today_trading": "š Today's Trading", + "ai_mentor.total_trades": "Total Trades:", + "ai_mentor.pnl": "P&L:", + "ai_mentor.emotion": "Emotion:", + "ai_mentor.your_notes": "Your Notes:", + "ai_mentor.view_full_analysis": "š§ View Full AI Analysis", + "ai_mentor.update_emotion": "āļø Update Emotion & Notes", + "ai_mentor.not_traded_today": "No Trading Today Yet", + "ai_mentor.start_trading": "Start trading to get personalized AI analysis!", + "ai_mentor.record_emotion": "š Record Trading Emotion", + "ai_mentor.ai_insights": "š¤ Latest AI Insights", + "ai_mentor.no_insights": "AI is Ready to Help!", + "ai_mentor.start_trading_insights": "Start trading to get personalized insights from your AI mentor.", + "ai_mentor.view_history": "š View All History", + "ai_mentor.daily_tips": "š” Daily Tips from AI Mentor", + "ai_mentor.consistency": "šÆ Consistency", + "ai_mentor.consistency_tip": "Small but consistent profits are better than one big profit followed by losses.", + "ai_mentor.risk_management": "š”ļø Risk Management", + "ai_mentor.risk_tip": "Never risk more than 2% of your capital per trade. Capital is a trader's life!", + "ai_mentor.emotion": "š§ Emotions", + "ai_mentor.emotion_tip": "Trading with a calm emotion is the key to professional trading. Take a break if frustrated.", + "ai_mentor.chat_with_mentor": "š¬ Chat with AI Mentor", + "ai_mentor.developing": "Feature under development...", + "ai_mentor.use_dashboard": "For now, use the dashboard to view AI analysis.", + "ai_mentor.history_page_title": "š AI Mentor History - QuantumBotX", + "ai_mentor.report_page_title": "š AI Mentor Report - QuantumBotX", + "ai_mentor.session_detail_title": "š Session Detail {{ session_date }} - AI Mentor - QuantumBotX", + "ai_mentor.holiday_risk_reduction": "ā ļø Automatic risk reduced {{ (100 - holiday_config.adjustments.risk_reduction * 100)|int }}% for holiday period", + "ai_mentor.holiday": "⢠{{ holiday_config.active_holiday.split()[0] }} š", + "ai_mentor.language_indonesian": "š®š© Bahasa Indonesia", + "ai_mentor.realtime_analysis": "š Real-time Analysis", + "ai_mentor.sessions": "trading sessions", + "ai_mentor.profit_sessions": "profit sessions", + "ai_mentor.no_trading": "no trading yet", + "ai_mentor.ai_status": "AI Status", + "ai_mentor.ai_active": "š¤ Active", + "ai_mentor.ready_to_analyze": "ready to analyze", + "ai_mentor.todays_trading": "Today's Trading", + "ai_mentor.view_full_analysis": "š§ View Full AI Analysis", + "ai_mentor.update_emotion": "āļø Update Emotion & Notes", + "ai_mentor.record_emotion": "š Record Trading Emotion", + "ai_mentor.latest_insights": "Latest AI Insights", + "ai_mentor.view_all_history": "š View All History", + "ai_mentor.ai_ready": "AI is Ready to Help!", + "ai_mentor.start_trading_for_insights": "Start trading to get personalized insights from your AI mentor.", + "ai_mentor.daily_tips": "Daily Tips from AI Mentor", + "ai_mentor.consistency": "šÆ Consistency", + "ai_mentor.consistency_tip": "Small but consistent profits are better than one big profit followed by losses.", + "ai_mentor.risk_management": "š”ļø Risk Management", + "ai_mentor.risk_management_tip": "Never risk more than 2% of your capital per trade. Capital is a trader's life!", + "ai_mentor.emotion": "š§ Emotions", + "ai_mentor.emotion_tip": "Trading with a calm emotion is the key to professional trading. Take a break if frustrated.", + "ai_mentor.chat_with_mentor": "š¬ Chat with AI Mentor", + "ai_mentor.feature_development": "Feature under development...", + "ai_mentor.use_dashboard": "For now, use the dashboard to view AI analysis.", + "ai_mentor.report_title": "š AI Mentor Report", + "ai_mentor.report_subtitle": "Personal analysis for {{ session_data.session_date if session_data else 'Today' }}", + "ai_mentor.created_by_ai": "š¤ Created by AI", + "ai_mentor.real_data": "š Real Data", + "ai_mentor.trades": "trades", + "ai_mentor.no_data": "No data", + "ai_mentor.back_to_dashboard": "Back to Dashboard", + "ai_mentor.report_history": "Report History", + "ai_mentor.trading_summary": "Trading Summary", + "ai_mentor.profit_loss": "Profit/Loss", + "ai_mentor.emotional_condition": "Emotional Condition", + "ai_mentor.market_conditions": "Market Conditions", + "ai_mentor.trading_patterns": "Trading Pattern Analysis", + "ai_mentor.main_pattern": "Main Pattern:", + "ai_mentor.strength": "Strength:", + "ai_mentor.improvement_areas": "Area for Improvement:", + "ai_mentor.emotional_analysis": "Emotional vs Performance Analysis", + "ai_mentor.emotional_feedback": "Emotional Feedback:", + "ai_mentor.tip": "Tip:", + "ai_mentor.risk_management_analysis": "Risk Management Evaluation", + "ai_mentor.recommendations": "AI Mentor Recommendations", + "ai_mentor.motivational_message": "Motivational Message", + "ai_mentor.trade_details": "Today's Trade Details", + "ai_mentor.lot_size": "Lot: {{ trade.lot_size }}", + "ai_mentor.sl": "SL: {{ 'ā ' if trade.stop_loss_used else 'ā' }}", + "ai_mentor.tp": "TP: {{ 'ā ' if trade.take_profit_used else 'ā' }}", + "ai_mentor.personal_notes": "Your Personal Notes", + "ai_mentor.no_trading_data": "No Trading Data Yet", + "ai_mentor.back_to_dashboard_button": "ā Back to Dashboard", + "ai_mentor.full_report": "Full AI Report", + "ai_mentor.view_full_report": "View Full Report", + "ai_mentor.history_title": "š AI Mentor Trading History", + "ai_mentor.history_subtitle": "Complete analysis of your trading journey with AI assistance", + "ai_mentor.performance_analysis": "š Performance Analysis", + "ai_mentor.ai_insights": "š§ AI Insights", + "ai_mentor.total_reports": "Total Reports", + "ai_mentor.sessions_analyzed": "sessions analyzed", + "ai_mentor.period": "Period", + "ai_mentor.days": "days", + "ai_mentor.last_history": "last history", + "ai_mentor.performance": "Performance", + "ai_mentor.total_pnl": "total P&L", + "ai_mentor.profit_sessions": "profit sessions", + "ai_mentor.period_filter": "Period Filter", + "ai_mentor.filter_7_days": "7 Days", + "ai_mentor.filter_30_days": "30 Days", + "ai_mentor.filter_90_days": "90 Days", + "ai_mentor.filter_1_year": "1 Year", + "ai_mentor.trading_session": "Trading Session", + "ai_mentor.ai_summary": "š¤ AI Summary:", + "ai_mentor.market": "Market", + "ai_mentor.view_details": "View Details ā", + "ai_mentor.load_more": "Load More", + "ai_mentor.no_history": "No Trading History Yet", + "ai_mentor.start_trading_for_history": "Start trading to get analysis and personal advice from your digital mentor.", + "ai_mentor.start_trading_session": "Start Trading Session", + "ai_mentor.view_trading_bots": "View Trading Bots", + "ai_mentor.how_are_you_feeling": "š§ How are you feeling about trading today?", + "ai_mentor.emotion_calm": "š Calm", + "ai_mentor.calm_description": "Clear mind, not rushed", + "ai_mentor.emotion_greedy": "š¤ Greedy", + "ai_mentor.greedy_description": "Want big profits, aggressive", + "ai_mentor.emotion_fearful": "š° Fearful", + "ai_mentor.fearful_description": "Worried about losses, hesitant", + "ai_mentor.emotion_frustrated": "š¤ Frustrated", + "ai_mentor.frustrated_description": "Annoyed by losing streak", + "ai_mentor.today_pnl": "š° Today's P&L (USD)", + "ai_mentor.pnl_placeholder": "Example: 25.50 or -15.30", + "ai_mentor.today_notes": "š Today's Trading Notes", + "ai_mentor.notes_placeholder": "Example: Focused on EURUSD today, used tight SL. Market was volatile due to NFP news...", + "ai_mentor.instant_feedback": "ā” Instant Feedback", + "ai_mentor.save_data": "š¾ Save Data", + "ai_mentor.ai_feedback": "š¤ AI Mentor Feedback:", + "ai_mentor.analyzing": "š¤ AI is analyzing your trading...", + "ai_mentor.emotional_analysis": "š§ Emotional Analysis:", + "ai_mentor.motivation": "šŖ Motivation:", + "ai_mentor.quick_tips": "š” Quick Tips:", + "ai_mentor.failed_feedback": "ā Failed to get feedback. Please try again.", + "ai_mentor.session_trading_detail": "š Session Trading Details", + "ai_mentor.full_analysis": "Complete analysis from AI Mentor Indonesia", + "ai_mentor.ai_analysis": "šŗšø AI Analysis", + "ai_mentor.personal_insights": "š§ Personal Insights", + "ai_mentor.performance_review": "š Performance Review", + "ai_mentor.total_pnl": "Total P&L", + "ai_mentor.total_trades": "Total Trades", + "ai_mentor.emotional_state": "Emotional State", + "ai_mentor.trading_summary": "š Trading Summary", + "ai_mentor.market_context": "š Market Context", + "ai_mentor.market_conditions": "Market Conditions", + "ai_mentor.personal_notes": "š Personal Notes", + "ai_mentor.ai_mentor_report": "š¤ AI Mentor Report", + "ai_mentor.emotional_analysis_vs_performance": "š Emotional vs Performance Analysis", + "ai_mentor.emotional_status": "Status Emosi: {{ session_data.emotions|title if session_data.emotions else 'Not Recorded' }}", + "ai_mentor.emotional_advice": "š” Emotional Advice", + "ai_mentor.ai_recommendations": "šÆ AI Recommendations", + "ai_mentor.motivation_inspiration": "š Motivation & Inspiration", + "ai_mentor.learning_points": "š Learning Points", + "ai_mentor.back_to_history": "Back to History", + "ai_mentor.back_to_history_button": "ā Back to History", + "ai_mentor.ai_mentor_dashboard": "AI Mentor Dashboard", + "ai_mentor.reanalyze": "š Re-analyze", + "ai_mentor.session_detail_title": "š Session Detail {{ session_date }} - AI Mentor - QuantumBotX", + "ai_mentor.settings_title": "āļø AI Mentor Settings - QuantumBotX", + "ai_mentor.settings_subtitle": "Customize your AI Trading Mentor experience to your preferences", + "ai_mentor.indonesia_setup": "šŗšø English Setup", + "ai_mentor.realtime_config": "ā” Real-time Configuration", + "ai_mentor.personal": "šÆ Personal", + "ai_mentor.language_regional": "š Language & Regional", + "ai_mentor.interface_language": "Interface Language", + "ai_mentor.language_choice": "Select language for AI Mentor", + "ai_mentor.timezone": "Timezone", + "ai_mentor.timezone_description": "Timezone for trading analysis", + "ai_mentor.timezone_wib": "WIB (UTC+7) - Jakarta Time", + "ai_mentor.currency_format": "Currency Format", + "ai_mentor.currency_display": "Profit/loss display format", + "ai_mentor.ai_behavior": "š§ AI Mentor Behavior", + "ai_mentor.automatic_analysis": "Automatic Analysis", + "ai_mentor.automatic_analysis_description": "AI automatically analyzes each trading session", + "ai_mentor.emotional_feedback": "Emotional Feedback", + "ai_mentor.emotional_feedback_description": "AI provides feedback based on emotional condition", + "ai_mentor.daily_motivation": "Daily Motivation", + "ai_mentor.daily_motivation_description": "Receive daily motivational messages", + "ai_mentor.analysis_detail_level": "Analysis Detail Level", + "ai_mentor.analysis_detail_description": "Level of detail in AI feedback", + "ai_mentor.basic": "Basic", + "ai_mentor.detailed": "Detailed", + "ai_mentor.expert": "Expert", + "ai_mentor.notifications": "š Notifications", + "ai_mentor.daily_report": "Daily Report", + "ai_mentor.daily_report_time": "Time to send AI daily report", + "ai_mentor.timezone_wib_short": "WIB", + "ai_mentor.trading_reminder": "Trading Reminder", + "ai_mentor.trading_reminder_description": "Reminders for emotion input and notes", + "ai_mentor.overtrading_alert": "Overtrading Alert", + "ai_mentor.overtrading_alert_description": "Warning if trading too much", + "ai_mentor.cultural_preferences": "š Cultural Preferences", + "ai_mentor.automatic_holiday_mode": "Automatic Holiday Mode", + "ai_mentor.automatic_holiday_mode_description": "Automatically activate Ramadan and Christmas modes", + "ai_mentor.ramadan_risk_adjustment": "Ramadan Risk Adjustment", + "ai_mentor.ramadan_risk_adjustment_description": "Automatically reduce risk during Ramadan", + "ai_mentor.sahur_iftar_pause": "Sahur/Iftar Trading Pause", + "ai_mentor.sahur_iftar_pause_description": "Automatically pause trading during sahur and iftar times", + "ai_mentor.data_privacy": "š Data & Privacy", + "ai_mentor.save_ai_history": "Save AI History", + "ai_mentor.save_ai_history_description": "How long to save AI analysis", + "ai_mentor.30_days": "30 Days", + "ai_mentor.90_days": "90 Days", + "ai_mentor.1_year": "1 Year", + "ai_mentor.unlimited": "Unlimited", + "ai_mentor.export_data": "Export Data", + "ai_mentor.export_data_description": "Download all your AI Mentor data", + "ai_mentor.export": "š„ Export", + "ai_mentor.reset_all_data": "Reset All Data", + "ai_mentor.reset_all_data_description": "ā ļø Delete all history and analysis", + "ai_mentor.reset": "šļø Reset", + "ai_mentor.save_settings": "š¾ Save Settings", + "ai_mentor.reset_to_defaults": "š Reset to Defaults", + "ai_mentor.back_to_dashboard": "ā Back to Dashboard", + // Units & Currencies "currency.usd": "USD", "currency.idr": "IDR", @@ -155,7 +969,237 @@ window.QuantumBotXI18n = { "settings.title": "Settings", "settings.language": "Language", "settings.theme": "Theme", - "settings.save": "Save Changes" + "settings.save": "Save Changes", + "settings.profile": "Profile", + "settings.preferences": "Preferences", + "settings.api_keys": "Exchange API Keys", + "settings.quick_settings": "Quick Settings", + "settings.email_notifications": "Email Notifications", + "settings.auto_update": "Auto Update Strategies", + "settings.demo_mode": "Demo Mode", + "settings.version": "Version", + "settings.last_updated": "Last Updated", + "settings.light": "Light", + "settings.dark": "Dark (Coming Soon)", + "settings.indonesian": "Indonesian", + "settings.english": "English", + "settings.api_info": "API Keys will be used by the next version of QuantumBotX to access non-MT5 brokers.", + "settings.api_placeholder": "This feature will be available in the next QuantumBotX API version.", + + // Trading Bots + "bots.title": "Trading Bots", + "bots.manage": "Manage all your bots and strategies.", + "bots.start_all_title": "Start all paused bots", + "bots.stop_all_title": "Stop all active bots", + "bots.name_market": "Name / Market", + "bots.parameters": "Parameters", + "bots.configuration": "Configuration", + "bots.actions": "Actions", + "bots.create_edit_modal": "Modal for Creating/Editing Bot", + "bots.create_new": "š Create New Bot", + "bots.close_modal": "Close modal", + "bots.row_name_market": "Row 1: Name & Market", + "bots.row_lot_sl_tp": "Row 2: Lot, SL, TP", + "bots.row_timeframe_interval": "Row 3: Timeframe & Interval", + "bots.enable_strategy_switching": "Enable Automatic Strategy Switching", + "bots.strategy_switching_info": "If enabled, the bot will automatically switch to the best strategy based on current performance.", + "bots.row_strategy_params": "Row 4: Strategy & Its Parameters", + "bots.strategy_params_loaded": "Strategy parameters will be loaded here by JavaScript", + "bots.create_bot": "Create Bot", + "bots.cancel": "Cancel", + "bots.example_name": "Example: XAUUSD Hybrid H1", + "bots.example_market": "Example: XAUUSD or EURUSD", + "bots.timeframe_1m": "1 Minute", + "bots.timeframe_5m": "5 Minutes", + "bots.timeframe_15m": "15 Minutes", + "bots.timeframe_30m": "30 Minutes", + "bots.timeframe_1h": "1 Hour", + "bots.timeframe_4h": "4 Hours", + "bots.timeframe_1d": "1 Day", + "bots.select_strategy": "Select a strategy", + "bots.detail_title": "Bot Detail - QuantumBotX", + + // Profile + "profile.title": "Profile", + "profile.my_profile": "My Profile", + "profile.loading": "Loading...", + "profile.joined_since": "Joined since: July 2025", + "profile.save_changes": "Save Changes", + "profile.password_placeholder": "ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢", + + // Holidays + "holiday.countdown.iftar": "ā±ļø Iftar Countdown", + "holiday.countdown.christmas": "š Christmas Countdown", + "holiday.countdown.new_year": "š New Year Countdown", + "holiday.countdown.days_until": "days until", + "holiday.patience_reminder": "š§āāļø Patience Reminder", + "holiday.risk_adjustment": "š”ļø Risk Adjustment", + "holiday.risk_reduction": "Automatic risk reduction", + "holiday.optimal_trading_hours": "ā° Optimal Trading Hours", + "holiday.christmas_greeting": "⨠Christmas Greeting", + "holiday.lot_adjustment": "š Lot Adjustment", + "holiday.lot_reduction": "Lot size reduction", + "holiday.new_year_resolution": "šÆ Trading Resolution", + "holiday.new_year_goal_setting": "The perfect time to set your trading goals for the year", + + // Backtesting + "backtest.enhanced_engine_active": "š Enhanced Backtesting Engine Active", + "backtest.includes": "Your backtesting now includes:", + "backtest.realistic_spread": "Realistic spread costs", + "backtest.actual_costs": "Actual trading costs deducted", + "backtest.atr_risk": "ATR-based risk management", + "backtest.dynamic_sizing": "Dynamic position sizing", + "backtest.instrument_protection": "Instrument protection", + "backtest.gold_safeguards": "Gold trading safeguards", + "backtest.slippage": "Slippage simulation", + "backtest.accurate_modeling": "More accurate execution modeling", + "backtest.upload_data": "Upload Historical Data (CSV)", + "backtest.enhanced": "š Enhanced", + "backtest.dynamic_sl": "Dynamic SL based on volatility", + "backtest.dynamic_tp": "Dynamic TP based on volatility", + "backtest.run": "Run Backtest", + "backtest.results": "Backtest Results", + "backtest.history_title": "Backtest History - QuantumBotX", + "backtest.running": "Running simulation...", + + // History + "history.title": "Global Transaction History", + "history.description": "All closed transactions from the MetaTrader 5 account.", + "history.symbol": "Symbol", + "history.type": "Type", + "history.volume": "Volume", + "history.profit": "Profit", + "history.close_time": "Close Time", + "history.magic": "Magic Number", + "history.loading": "Loading history...", + + // Portfolio + "portfolio.title": "Real-Time Portfolio", + "portfolio.description": "Open trading positions in the MetaTrader 5 account.", + "portfolio.pnl_chart": "Open Profit/Loss Chart (Real-Time)", + "portfolio.open_pnl_total": "Open P/L Total", + "portfolio.allocation_chart": "Asset Allocation", + "portfolio.symbol": "Symbol", + "portfolio.type": "Type", + "portfolio.volume": "Volume", + "portfolio.open_price": "Open Price", + "portfolio.profit_loss": "Profit/Loss", + "portfolio.magic": "Magic Number", + "portfolio.loading": "Loading open positions...", + "portfolio.no_open_positions": "No open positions yet", + + // Market Data + "market.forex_title": "Forex Market", + "market.forex_description": "Real-time price data from the foreign exchange market.", + "market.stocks_title": "Stocks Market", + "market.stocks_description": "Real-time price data from the global stock market.", + "market.pair": "Pair", + "market.bid_price": "Bid Price", + "market.ask_price": "Ask Price", + "market.spread": "Spread", + "market.stock": "Stock", + "market.price": "Price", + "market.change_24h": "24h Change", + "market.time": "Time", + "market.loading": "Loading data...", + "market.close": "Close", + + // Strategy Switcher + "strategy_switcher.title": "Strategy Switcher Dashboard", + "strategy_switcher.header": "š Automatic Strategy Switcher", + "strategy_switcher.subtitle": "Real-time monitoring and performance analytics for automatic strategy switching", + "strategy_switcher.current_status": "Current Status", + "strategy_switcher.manual_evaluate": "Manual Evaluate", + "strategy_switcher.loading": "Loading...", + "strategy_switcher.cooldown_active": "Cooldown Active", + "strategy_switcher.active": "Active", + "strategy_switcher.active_strategy": "Active Strategy", + "strategy_switcher.active_symbol": "Active Symbol", + "strategy_switcher.last_switch": "Last Switch", + "strategy_switcher.never": "Never", + "strategy_switcher.performance_rankings": "š Strategy Performance Rankings", + "strategy_switcher.refresh_rankings": "Refresh Rankings", + "strategy_switcher.rank": "Rank", + "strategy_switcher.strategy_symbol": "Strategy/Symbol", + "strategy_switcher.composite_score": "Composite Score", + "strategy_switcher.profitability": "Profitability", + "strategy_switcher.risk_control": "Risk Control", + "strategy_switcher.market_fit": "Market Fit", + "strategy_switcher.no_rankings": "No strategy rankings available", + "strategy_switcher.recent_switches": "ā” Recent Strategy Switches", + "strategy_switcher.refresh_switches": "Refresh Switches", + "strategy_switcher.no_switches": "No strategy switches recorded yet.", + "strategy_switcher.monitored_instruments": "š Monitored Instruments & Strategies", + "strategy_switcher.instruments": "Instruments", + "strategy_switcher.strategies": "Strategies", + "strategy_switcher.none": "None", + "strategy_switcher.switch_from": "Switched from", + "strategy_switcher.switch_to": "to", + "strategy_switcher.initialized_with": "Initialized with", + "strategy_switcher.manual_trigger_confirm": "Are you sure you want to manually trigger strategy evaluation?", + "strategy_switcher.loading_strategy_rankings": "Loading strategy rankings...", + "strategy_switcher.loading_recent_switches": "Loading recent switches...", + "strategy_switcher.monitored_instruments_strategies": "š Monitored Instruments & Strategies", + "strategy_switcher.score": "Score:", + "strategy_switcher.no_strategy_rankings": "No strategy rankings available", + "strategy_switcher.switched_from": "Switched from", + "strategy_switcher.switched_to": "to", + "strategy_switcher.no_strategy_switches": "No strategy switches recorded yet.", + "strategy_switcher.strategy_performance_rankings": "š Strategy Performance Rankings", + "strategy_switcher.recent_strategy_switches": "ā” Recent Strategy Switches", + + // Ramadan + "ramadan.title": "Ramadan Trading Mode", + "ramadan.page_title": "š Ramadan Trading Mode - QuantumBotX", + "ramadan.header": "š Ramadan Trading Mode", + "ramadan.subtitle": "Holy month with trading features that respect fasting worship", + "ramadan.info": "This mode is automatically active during Ramadan and will adjust your trading settings to respect worship times. You don't need to activate it manually.", + "ramadan.status": "Ramadan Status", + "ramadan.period": "Ramadan Period", + "ramadan.greeting": "Ramadan Greeting", + "ramadan.iftar_countdown": "ā±ļø Iftar Countdown", + "ramadan.hours": "Hours", + "ramadan.minutes": "Minutes", + "ramadan.until": "Until", + "ramadan.trading_adjustments": "āļø Trading Adjustments", + "ramadan.fasting_times": "Fasting Rest Times", + "ramadan.suhoor": "Sahur", + "ramadan.suhoor_time": "03:30 - 05:00 WIB", + "ramadan.iftar_time": "Iftar", + "ramadan.iftar_time_range": "18:00 - 19:30 WIB", + "ramadan.tarawih": "Tarawih", + "ramadan.tarawih_time": "20:00 - 21:30 WIB", + "ramadan.risk_adjustments": "Risk Adjustments", + "ramadan.reduced_risk_mode": "Reduced Risk Mode", + "ramadan.reduced_risk_description": "20% risk reduction during fasting", + "ramadan.patience_mode": "Patience Mode", + "ramadan.patience_mode_description": "Focus on quality not quantity", + "ramadan.optimal_hours": "Optimal Hours", + "ramadan.optimal_hours_time": "22:00 - 03:00 WIB", + "ramadan.zakat_calculator": "š° Trading Zakat Calculator", + "ramadan.zakat_information": "Zakat Information", + "ramadan.gold_nisab": "Gold Nisab", + "ramadan.silver_nisab": "Silver Nisab", + "ramadan.zakat_percentage": "Zakat Percentage", + "ramadan.zakat_reminder": "Zakat Reminder", + "ramadan.zakat_trading_reminder": "Trading zakat: 2.5% of trading profits during 1 hijri year. Don't forget to calculate zakat from your trading profits during Ramadan.", + "ramadan.patience_reminder": "š§āāļø Patience Reminder", + "ramadan.loading": "Loading...", + "ramadan.active": "Active", + "ramadan.inactive": "Inactive", + "ramadan.not_ramadan": "Not Ramadan period", + "ramadan.default_greeting": "Time to fast, time to trade with blessings", + + // Other + "common.close": "Close", + "common.yes": "Yes", + "common.no": "No", + + // Notifications + "notifications.loading": "Loading notifications...", + + // AI Mentor Settings + "ai_mentor.settings_title": "āļø AI Mentor Settings - QuantumBotX" } }, @@ -165,7 +1209,7 @@ window.QuantumBotXI18n = { // Initialize i18n system init: function() { this.loadLanguage(); - this.createLanguageSwitcher(); + this.setupLanguageSwitcher(); this.applyTranslations(); }, @@ -177,33 +1221,35 @@ window.QuantumBotXI18n = { } }, - // Create global language switcher (can be embedded anywhere) - createLanguageSwitcher: function() { - // Check if already exists - if (document.getElementById('global-lang-switcher')) return; + // Set up language switcher buttons (works with existing buttons in header) + setupLanguageSwitcher: function() { + // Update button states based on current language + this.updateLanguageButtonState(); - const switcher = document.createElement('div'); - switcher.id = 'global-lang-switcher'; - switcher.className = 'fixed top-4 right-4 z-50 flex items-center space-x-2 bg-white rounded-lg shadow-lg border p-1'; - - switcher.innerHTML = ` - - - `; - - // Add event listeners - switcher.querySelectorAll('.lang-btn').forEach(btn => { - btn.addEventListener('click', () => { - const newLang = btn.dataset.lang; - this.setLanguage(newLang); - }); + // Add click handlers to all language buttons + document.addEventListener('click', (e) => { + if (e.target.classList.contains('lang-btn')) { + e.preventDefault(); + const newLang = e.target.dataset.lang; + if (newLang && newLang !== this.currentLang) { + this.setLanguage(newLang); + } + } }); + }, - // Insert into page (after body loads) - document.addEventListener('DOMContentLoaded', () => { - document.body.appendChild(switcher); + // Update the visual state of language buttons + updateLanguageButtonState: function() { + const langBtns = document.querySelectorAll('.lang-btn'); + langBtns.forEach(btn => { + const btnLang = btn.dataset.lang; + if (btnLang === this.currentLang) { + btn.classList.add('bg-blue-600', 'text-white'); + btn.classList.remove('text-gray-600', 'hover:bg-gray-100'); + } else { + btn.classList.remove('bg-blue-600', 'text-white'); + btn.classList.add('text-gray-600', 'hover:bg-gray-100'); + } }); }, @@ -217,14 +1263,8 @@ window.QuantumBotXI18n = { this.currentLang = lang; localStorage.setItem('quantumBotX_language', lang); - // Update switcher buttons - const switcher = document.getElementById('global-lang-switcher'); - if (switcher) { - switcher.querySelectorAll('.lang-btn').forEach(btn => { - const isActive = btn.dataset.lang === lang; - btn.className = `lang-btn px-3 py-1 rounded text-sm ${isActive ? 'bg-blue-500 text-white' : 'text-gray-600 hover:bg-gray-100'}`; - }); - } + // Update the visual state of the buttons + this.updateLanguageButtonState(); this.applyTranslations(); this.onLanguageChange(lang); @@ -244,22 +1284,37 @@ window.QuantumBotXI18n = { return fallback || key; }, - // Apply translations to all elements with data-i18n attribute applyTranslations: function() { + // Handle page title translation using a data attribute on the
Total P/L Terbuka
+${window.QuantumBotXI18n.t('portfolio.open_pnl_total')}
${formatCurrency(totalProfit)} ${trendIcon}
`; previousTotalProfit = totalProfit; diff --git a/templates/404.html b/templates/404.html index f995e0c..8754369 100644 --- a/templates/404.html +++ b/templates/404.html @@ -3,7 +3,7 @@ -Maaf, halaman yang Anda cari tidak ada atau telah dipindahkan.
+Maaf, halaman yang Anda cari tidak ada atau telah dipindahkan.