Commit Graph

5 Commits

Author SHA1 Message Date
Reynov Christian 243bdda80c Enhance backtesting with dynamic position sizing and ATR-based SL/TP
```

The commit introduces significant improvements to the backtesting functionality:

1. Added dynamic position sizing based on risk percentage
2. Implemented ATR-based stop loss and take profit calculations
3. Enhanced backtest state management with detailed trade tracking
4. Updated database schema to store additional backtest metrics
5. Modified UI components to display new backtest results
6. Added logging and error handling improvements
7. Removed the London Breakout strategy from the codebase

These changes improve the depth and accuracy of backtesting while providing more comprehensive performance metrics.
2025-08-23 12:11:32 +08:00
Reynov Christian 1a288998d5 feat(risk): Implement ATR-based Stop Loss & Take Profit 2025-08-21 23:36:25 +08:00
Reynov Christian 88bc159b76 feat(backtesting, strategies, ui): Enhance backtesting, add new strategies, and improve UI/UX
This commit introduces significant improvements across the application, focusing on a robust backtesting experience, new trading strategies, and enhanced user interface.

Backtesting Module:
- Implemented comprehensive backtest history functionality, including detailed metrics, equity curve, parameters, and trade logs.
- Resolved `NOT NULL` constraint errors for `wins` and `losses` by updating DB schema and `init_db.py` and `save_backtest_result` logic.
- Consolidated `/api/backtest/history` route to `api_backtest.py`, removing duplication from `api_history.py`.
- Ensured `value_per_pip` calculation in `engine.py` is accurate for all symbols (especially XAU/XAG).
- Removed unused `profit` variable in `engine.py`.
- Deleted redundant `engine.py` file from project root.

Trading Strategies:
- **Mercy Edge**: Activated and synchronized `analyze` (live) and `analyze_df` (backtest) methods, using SMA 200 as trend filter.
- **Pulse Sync**: Re-implemented as a distinct strategy (RSI Crossover with SMA 100 trend filter), providing a more responsive alternative to Mercy Edge.
- **RSI Breakout (now RSI Crossover)**: Transformed into a powerful RSI-MA Crossover strategy with SMA 50 trend filter, significantly improving performance on EURUSD and becoming a top performer on XAUUSD/USDJPY.
- **Turtle Breakout**: Integrated as a new, classic trend-following strategy, fully functional for both live and backtesting.
- Updated `strategy_map.py` to reflect new strategy names and additions (`BOLLINGER_REVERSION`, `RSI_CROSSOVER`, `TURTLE_BREAKOUT`).

UI/UX Improvements:
- Enhanced Backtest History UI to display strategy, market/pair, and all detailed metrics.
- Updated `README.md` to reflect the new Backtester feature and streamlined donation section.
2025-08-08 17:07:40 +08:00
Reynov Christian 7b74743d58 Refactor and update forex and stock modal handling in JavaScript
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.
2025-08-08 10:39:03 +08:00
Reynov Christian 53ae5e8861 Refactor app and templates for backtesting and active page tracking
- 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.
2025-08-02 21:26:22 +08:00