Reynov Christian 73fe9cdca2 feat: Add Quantum Velocity strategy and major stability overhaul" -m "
This major commit introduces a new advanced trading strategy, resolves critical trading logic errors, and significantly enhances system stability and UI data accuracy.

Key Changes:

- **New Features & Strategies**:
  - **Quantum Velocity Strategy**: Added 'quantum_velocity.py', a new hybrid strategy combining a long-term trend filter (EMA 200) with a volatility-based entry trigger (Bollinger Squeeze).
  - **Hybrid Pro Backtester**: Added 'lab/backtester_hybrid_pro.py' to facilitate advanced, offline testing and optimization of the QuantumBotX Hybrid strategy.

- **Critical Trading Logic Fixes**:
  - Resolved 'Invalid Stops' and 'Unsupported filling mode' errors by refactoring 'core/mt5/trade.py' to use dynamic point calculation and the FOK fill policy.
  - Fixed a recurring 'KeyError' in 'BollingerSqueezeStrategy' by ensuring consistent naming for Bollinger Bands columns.

- **System Stability & Robustness**:
  - Hardened the graceful shutdown handler in 'app.py' to prevent crashes from repeated Ctrl+C signals, ensuring a clean shutdown process.
  - Enhanced the notification system by adding an 'is_notification' flag to logs, allowing for a clear distinction between critical alerts and general activity.

- **Dashboard & UI Enhancements**:
  - Fixed the 'Total Bots' card on the dashboard by correcting the backend API ('api_dashboard.py') to send the complete stats payload.
  - Replaced static '0' values on dashboard cards with loading spinners for a more professional user experience.
  - The 'Create/Edit Bot' modal button now dynamically changes its text to 'Ubah Bot' when in edit mode.
2025-08-01 22:47:37 +08:00

🤖 QuantumBotX — AI-Powered Modular Trading Bot for MT5

!MIT License !Python Version !Framework !Made with Love

Welcome to QuantumBotX, your personal, modular, and smart trading assistant built with Python and MetaTrader5 (MT5). Designed to be elegant, powerful, and flexible — whether you're a scalper, swing trader, or a strategy researcher.


🚀 Features

  • Modular Strategy System: Easily create and plug in your own trading strategies.
  • Real-Time Analysis: Live dashboard with data visualization using Chart.js.
  • Adaptive Logic: Comes with a Hybrid strategy that adapts to trending or ranging markets.
  • Automated Trading: Full position handling (entry, exit, SL, TP) using bot-specific magic numbers.
  • Persistent Logging: All activities and trades are logged to a local SQLite database.
  • Modern Web UI: Clean and responsive dashboard built with Flask and TailwindCSS.
  • Multi-Timeframe Support: Analyze and trade on any standard timeframe from M1 to D1.
  • Live/Demo Ready: Tested and ready for both demo and live trading accounts.

📦 Tech Stack

  • Python 3.10+
  • Flask & TailwindCSS
  • MetaTrader5 Python Integration
  • pandas & pandas-ta for data analysis
  • Chart.js for data visualization
  • SQLite for database

🧠 Strategy Examples

Strategy Description Best For
Moving Average Crossover Classic Golden/Death Cross. Trending markets (e.g., Indices, XAUUSD).
Bollinger Bands Reversion Mean reversion based on price touching the bands. Ranging/Volatile markets (e.g., EURUSD).
QuantumBotX Hybrid Adaptive strategy using ADX to switch between MA Crossover and Bollinger Bands. All-weather performance.

📈 Roadmap

  • Advanced Strategy: MACD_STOCH_FILTER for more precise, filtered entries.
  • Backtesting Module: A simple UI to test strategies against historical data.
  • Telegram Notifications: Get real-time alerts for trades and errors.
  • Portfolio Analytics: Deeper insights into your trading performance.

🔐 Environment Variables (.env)

Rename .env.example to .env, and fill in the following:

MT5_LOGIN="your_mt5_login"
MT5_PASSWORD="your_password"
MT5_SERVER="your_broker_server"
SECRET_KEY="any_flask_secret_key"
DB_NAME=bots.db

Note: The API keys for Alpha Vantage, CMC, and Finnhub are deprecated and can be ignored.


🧪 Local Setup (Dev Mode)

  1. Clone the repository:
    git clone https://github.com/rebarakaz/quantumbotx.git
    cd quantumbotx
    
  2. Set up Python virtual environment:
    python -m venv venv
    # On Windows
    .\venv\Scripts\activate
    # On macOS/Linux
    source venv/bin/activate
    
  3. Install dependencies:
    pip install -r requirements.txt
    
  4. Configure your environment:
    cp .env.example .env
    # Now, edit the .env file with your MT5 credentials
    
  5. Run the application:
    python app.py
    

Important: You must have the MetaTrader 5 terminal installed and running on the same machine.


⚠️ Disclaimer

Trading foreign exchange on margin carries a high level of risk and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade, you should carefully consider your investment objectives, level of experience, and risk appetite.

This software is provided "as is" for educational and research purposes. The author is not responsible for any financial losses incurred from using this bot. Always test thoroughly on a demo account before using on a live account.


📈 Screenshot

QuantumBotX Dashboard Preview


🧠 Author

Developed with 💖 by Chrisnov IT Solutions Concept, Logic & Execution: @reynov aka BabyDev


Support This Project

If you like this project, give it a on GitHub, or buy me a coffee to support future versions:

// eslint-disable-next-line markdown/fenced-code-language

BTC Wallet: bc1qxxxxxxxxxxxxxx
USDT TRC20: TRxxxxxxxxxxxx

📝 License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Languages
Python 65.8%
HTML 17.1%
JavaScript 16.6%
NSIS 0.4%