Refactor the JavaScript code to use a single modal for both forex and stock profiles. Update error handling to display server error messages. Remove unused app.py and fetch.py files. Adjust various routes and strategies for consistency.
- Update `app.py` to include backtesting routes and improve blueprint registration.
- Modify templates to include an active page parameter for navigation highlighting.
- Remove unused `crypto_data.py` and `api_crypto.py`.
- Add new backtesting-related files and templates.
- Implement `start_all_bots` and `stop_all_bots` functions in `controller.py` to handle starting and stopping all bots.
- Add corresponding API routes in `api_bots.py` for starting and stopping all bots.
- Update `trading_bots.js` to include UI elements and event listeners for starting and stopping all bots.
- Improve `stop_bot` function to prevent race conditions by using `pop()` on `active_bots`.
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.
Removed eslint.config.js from .gitignore and started tracking the actual eslint.config.mjs file. This ensures consistent code style rules for all collaborators.
Successfully run QuantumBotX Hybrid on XAUUSD after fixing critical bugs (KeyError, data fetching). Improved UI with scrollable modal and implemented graceful shutdown for the server. System is now more robust and user-friendly.
- Update `controller.py` to handle cases where no bots are loaded and to restart active bots.
- Modify `trade.py` to use literal values for filling modes to ensure compatibility with different MT5 library versions.
- Update `.gitignore` to include `lab/` for backtesting and raw data.
- Refactor `app.py` to improve error handling and logging.
- Remove deprecated files: `core/bot_logic.py`, `core/bots/base_bot.py`, `core/bots/manager.py`, `core/db/database.py`, `core/routes/api_analysis.py`, `core/routes/api_bots_analysis.py`, `core/strategies/logic_ma.py`, `core/strategies/logic_rsi.py`.
- Modify multiple files to enhance bot management, routing, and strategy handling.
- Update JavaScript and HTML templates for better UI and functionality.
Perubahan ini mencakup:
- Penataan ulang struktur direktori
- Peningkatan dokumentasi
- Penghapusan kode yang tidak terpakai
- Peningkatan performa di beberapa fungsi
Commit ini bertujuan untuk mempersiapkan basis kode untuk pengembangan lebih lanjut.
Referensi: #1234
---