48 Commits
Author SHA1 Message Date
Simon Moisy 65f30a4020 Enhance backtesting framework with static task processing and progress management. Introduced static task processing for parallel execution, improved error handling, and added a progress manager for better task tracking. Updated BacktestRunner to support progress callbacks and optimized worker allocation based on system resources. Added new configuration files for flexible backtesting setups. 2025-07-10 10:23:41 +08:00
Simon Moisy be331ed631 Remove unused GSheetBatchPusher class and xgboost model file to streamline codebase and eliminate deprecated components. 2025-06-25 13:11:17 +08:00
Simon Moisy 6c5dcc1183 Implement backtesting framework with modular architecture for data loading, processing, and result management. Introduced BacktestRunner, ConfigManager, and ResultProcessor classes for improved maintainability and error handling. Updated main execution script to utilize new components and added comprehensive logging. Enhanced README with detailed project overview and usage instructions. 2025-06-25 13:08:07 +08:00
Simon Moisy 02e5db2a36 Added comprehensive rules for global development standards, architecture guidelines, code review processes, context management, PRD creation, documentation standards, enhanced task list management, task generation, iterative workflow, project-specific rules, refactoring practices, and task list management. These rules aim to improve code quality, maintainability, and integration of AI-assisted development. 2025-06-25 13:07:14 +08:00
Simon Moisy a877f14e65 loo on features 2025-05-30 20:06:28 +08:00
Simon Moisy 082a2835b6 Implemented Supertrend indicators for feature engineering in main.py, including caching of computed features. Updated plotting functions in plot_results.py to save charts in a dedicated directory and added new functions for directional accuracy and prediction transition heatmaps. 2025-05-30 18:14:42 +08:00
Simon Moisy ada6150413 Added multiple technical indicators for feature engineering, including ADX, TRIX, Vortex, KAMA, Force Index, EOM, MFI, ADI, TEMA, StochRSI, and Awesome Oscillator. Improved NaN handling and implemented leave-one-out feature evaluation with results saved to CSV. 2025-05-30 17:59:09 +08:00
Simon Moisy ced64825bd reverted to sequential computing for features, added one distribution visualization graph 2025-05-30 15:54:48 +08:00
Simon Moisy 2f98463df8 more uv updates 2025-05-30 15:54:14 +08:00
Simon Moisy 2a52ffde9a cleanup and uv updates 2025-05-30 15:36:43 +08:00
Simon Moisy a22914731f gitignore updated, model file 2025-05-30 12:31:20 +08:00
Simon Moisy 81e4b640a7 model updated 2025-05-30 12:29:37 +08:00
Simon Moisy 2dba88b620 Added mode indicators, still WIP 2025-05-29 12:45:45 +08:00
Simon Moisy de67b27e37 XGBoost first iteration 2025-05-29 18:28:53 +08:00
Simon Moisy 1284549106 progress print 2025-05-29 11:04:03 +08:00
Simon Moisy 5f03524d6a never fallback to default values for fee_usd 2025-05-28 02:50:40 +08:00
Simon Moisy b013183f67 attempt fix for lookahead bias 2025-05-27 18:08:42 +08:00
Simon Moisy 74c8048ed5 shifted one day back on the metatrend to avoid lookahead bias, reverted metatrend calculus to use no cpu optimization for readability 2025-05-27 17:49:55 +08:00
Simon Moisy 6916722a43 Merge branch 'main' of ssh://dep.sokaris.link:2222/Simon/Cycles 2025-05-27 16:48:33 +08:00
Simon Moisy 47551d6781 ignoring credentials jsons 2025-05-27 16:47:20 +08:00
Simon Moisy 1566044fa8 Merge branch 'main' of ssh://dep.sokaris.link:2222/Simon/Cycles 2025-05-23 17:17:20 +08:00
Simon Moisy 3483aaf6d7 Add CryptoComTrader class and main execution script for trading operations
- Introduced the CryptoComTrader class to handle WebSocket connections for real-time trading data and operations.
- Implemented methods for fetching price, order book, user balance, and placing orders.
- Added functionality to retrieve candlestick data and available trading instruments.
- Created a main script to initialize the trader, fetch instruments, and display candlestick data in a loop.
- Integrated Plotly for visualizing candlestick data, enhancing user interaction and data representation.
2025-05-23 17:14:26 +08:00
Simon Moisy e5c2988d71 Refactor Backtest class and update strategy functions for improved modularity
- Refactored the Backtest class to encapsulate state and behavior, enhancing clarity and maintainability.
- Updated strategy functions to accept the Backtest instance, streamlining data access and manipulation.
- Introduced a new plotting method in BacktestCharts for visualizing close prices with trend indicators.
- Improved handling of meta_trend data to ensure proper visualization and trend representation.
- Adjusted main execution logic to support the new Backtest structure and enhanced debugging capabilities.
2025-05-22 20:02:14 +08:00
Simon Moisy 45c853efab Moved supertrend.py to Analysis subfolder 2025-05-22 17:09:29 +08:00
Simon Moisy 268bc33bbf Merge branch 'main' of ssh://dep.sokaris.link:2222/Simon/Cycles 2025-05-22 17:05:39 +08:00
Simon Moisy e286dd881a - Refactored the Backtest class for strategy modularity
- Updated entry and exit strategy functions
2025-05-22 17:05:19 +08:00
Simon Moisy f4873c56ff minor fixes 2025-05-21 17:23:35 +08:00
Simon Moisy 2fd73085b8 Refactor backtest logic for improved index retrieval
- Updated the method for determining the start index of the current trade to directly use the DataFrame index, enhancing clarity and performance.
- Removed the deprecated get_current_min1_end_idx method to streamline the codebase.
2025-05-21 17:06:16 +08:00
Simon Moisy 806697116d Refactor backtesting logic and introduce new components
- Replaced TrendDetectorSimple with a new Backtest class for improved backtesting functionality.
- Integrated argparse for configuration file input, allowing dynamic parameter setting.
- Added MarketFees and Supertrends classes to handle fee calculations and trend detection, respectively.
- Removed deprecated main_debug.py and trend_detector_simple.py files to streamline the codebase.
- Enhanced process_timeframe_data to utilize the new Backtest class for executing trades and calculating results.
- Updated Storage class to support writing backtest results with metadata.
2025-05-21 17:03:34 +08:00
Simon Moisy 14905017c8 Add total fees calculation to storage results
- Included total_fees_usd in the results dictionary of the Storage class to enhance fee tracking in the output.
- removed plots from TrendDetectorSimple
2025-05-21 15:35:12 +08:00
Simon Moisy ec1a86e098 Fixing last merge 2025-05-21 15:14:00 +08:00
Simon Moisy 0a919f825e Merge branch 'main' of ssh://dep.sokaris.link:2222/Simon/Cycles 2025-05-21 15:06:56 +08:00
Simon Moisy c2886a2aab Enhance trading logic and fee calculations in main.py and trend_detector_simple.py
- Added total fees calculation to process_timeframe_data and aggregate_results functions in main.py.
- Updated trade logging in TrendDetectorSimple to include transaction fees in USD.
- Introduced calculate_okx_fee function for consistent fee calculations based on maker/taker status.
- Adjusted backtesting logic to account for fees when buying and selling, ensuring accurate profit calculations.
- Expanded stop loss percentages and timeframes for broader analysis in main.py.
2025-05-21 14:54:44 +08:00
Simon Moisy 8ff86339d6 Add taxes functionality and refactor trading logic
- Introduced Taxes class in taxes.py to calculate and apply taxes on profits in backtest results.
- Updated main.py to include tax calculations in the results processing flow.
- Refactored trade logging in TrendDetectorSimple to account for transaction fees and ensure accurate profit calculations.
- Added a utility script (apply_taxes_to_file.py) for applying taxes to existing CSV files.
- Adjusted date range and timeframe settings in main.py for broader analysis.
2025-05-20 16:14:40 +08:00
Simon Moisy 7f788a4d4e Update .gitignore to include JSON files for version control, ensuring proper handling of data formats in the project. 2025-05-19 18:04:24 +08:00
Simon Moisy 0eb7fc77f9 Enhance data loading in main.py to support both CSV and JSON formats, improving flexibility for input data. Update date filtering and logging for better traceability. Refactor trade collection logic to ensure all trades are captured and written to separate CSV files by timeframe and stop loss percentage. Adjusted main execution parameters for broader timeframe analysis. 2025-05-19 17:35:17 +08:00
Simon Moisy 170751db0e Implement Google Sheets integration in main.py for batch updates of backtest results
- Added GSheetBatchPusher class to handle background updates to Google Sheets.
- Refactored write_results_per_combination function to write results directly to Google Sheets instead of CSV files.
- Updated process_timeframe function to handle single stop loss percentages.
- Introduced a global queue for batching results and trades for efficient updates.
- Enhanced error handling for Google Sheets API quota limits.
- Adjusted main execution flow to start the batch pusher and ensure all results are pushed after processing.
2025-05-19 02:02:03 +08:00
Simon Moisy f7f0fc6dd5 Cleanup 2025-05-17 14:48:30 +08:00
Simon Moisy e4ded694b1 Update .gitignore to exclude PNG files from version control 2025-05-17 14:48:13 +08:00
Simon Moisy fa12bcb61a Update .gitignore to exclude CSV files from version control 2025-05-17 14:47:51 +08:00
Simon Moisy 125d4f7d52 Add BacktestCharts class for visualizing backtest results and update main.py for enhanced data processing
- Introduced BacktestCharts class in charts.py to plot profit ratio vs stop loss and average trade vs stop loss for different timeframes.
- Updated main.py to integrate new charting functionality and streamline data processing without monthly splits.
- Enhanced backtesting logic in TrendDetectorSimple to include transaction costs and improved stop loss handling using 1-minute data for accuracy.
- Added functionality to write results to individual CSV files for better organization and analysis.
2025-05-17 13:07:40 +08:00
Simon Moisy ec8b1a7cf2 Enhance main.py with optimized data loading, logging setup, and concurrent processing for backtesting. Introduce new functions for data handling and results aggregation. Update TrendDetectorSimple to support meta supertrend backtesting and improve SuperTrend calculations with caching and parallel execution. Refactor TrendDetectorMACD for better performance in trend detection. 2025-05-16 02:44:22 +08:00
Simon Moisy 7c4db08b1b Refactor main.py to remove commented-out cycle detection code and streamline trend plotting. Update TrendDetectorSimple by eliminating unnecessary logging statements for improved clarity during trend detection. 2025-05-09 15:24:10 +08:00
Simon Moisy f316571a3c Update date filtering in main.py and enhance TrendDetectorSimple with SuperTrend calculations and improved plotting functionality. Introduce color configurations for better visualization and streamline trend analysis methods. 2025-05-09 15:17:30 +08:00
Simon Moisy c7732881c5 Refactor TrendDetectorSimple by removing redundant method definitions for trend detection and plotting, streamlining the code for better readability. 2025-05-09 12:27:40 +08:00
Simon Moisy b0ffedc6af Update .gitignore to include additional files and modify README header 2025-05-09 12:26:42 +08:00
Simon Moisy e9bfcd03eb Refactor cycle detection and trend analysis; enhance trend detection with linear regression and moving averages. Update main script for improved data handling and visualization. 2025-05-09 12:26:42 +08:00
Simon Moisy 0bbe308321 first trend detection WIP 2025-05-06 15:24:36 +08:00