Commit Graph

32 Commits

Author SHA1 Message Date
e9b4878ffa Refactor BacktestExecutor and TradingBotBase for performance optimizations; remove unused SignalCache and pre-calculation logic; implement caching for open position state and streamline signal access with TryGetValue; enhance logging for detailed timing breakdown during backtest execution. 2025-12-20 10:05:07 +07:00
5bd03259da Add BacktestSpotBot and update BacktestExecutor for spot trading support
- Introduced BacktestSpotBot class to handle backtesting for spot trading scenarios.
- Updated BacktestExecutor to support both BacktestFutures and BacktestSpot trading types.
- Enhanced error handling to provide clearer messages for unsupported trading types.
- Registered new command handlers for OpenSpotPositionRequest and CloseSpotPositionCommand in ApiBootstrap.
- Added unit tests for executing backtests with spot trading configurations, ensuring correct behavior and metrics validation.
2025-12-01 23:41:23 +07:00
Oda
9d536ea49e Refactoring TradingBotBase.cs + clean architecture (#38)
* Refactoring TradingBotBase.cs + clean architecture

* Fix basic tests

* Fix tests

* Fix workers

* Fix open positions

* Fix closing position stucking the grain

* Fix comments

* Refactor candle handling to use IReadOnlyList for chronological order preservation across various components
2025-12-01 19:32:06 +07:00
e1f2f75c23 Fix redundant recover position call 2025-11-19 20:42:11 +07:00
096fb500e4 Add position count property map 2025-11-19 14:16:30 +07:00
68e9b2348c Add PositionCount property to Backtest models and responses
- Introduced PositionCount to Backtest, LightBacktest, and their respective response models.
- Updated BacktestController and BacktestExecutor to include PositionCount in responses.
- Modified database schema to accommodate new PositionCount field in relevant entities.
2025-11-18 22:23:20 +07:00
428e36d744 Add todo for backtest performance 2025-11-15 20:53:08 +07:00
bed25e7222 Optimize backtest memory usage by implementing a rolling window for candle storage and update performance benchmarks with new test data. 2025-11-15 13:54:39 +07:00
6d661f459e Remove candle from backtest return + fix message when good backtest 2025-11-14 20:49:02 +07:00
b4005a2d1e Add telemetry for update signal and run bot 2025-11-14 20:22:01 +07:00
258dd48867 Add more logs for backtest completed 2025-11-14 13:27:20 +07:00
42993735d0 Add logs for BacktestExecutor.cs 2025-11-14 13:17:48 +07:00
460a7bd559 Fix realized pnl on backtest save + add tests (not all passing) 2025-11-14 02:38:15 +07:00
1f7d914625 Add cancellation token support to backtest execution and update progress handling 2025-11-13 18:05:55 +07:00
2cc6cc5dee Refactor BacktestExecutor to use net PnL calculations consistently across methods. Updated variable names for clarity and ensured final results reflect net profit after fees. Minor adjustment in TradingBotBase to directly access net PnL from position profit and loss. 2025-11-13 11:56:11 +07:00
3b176c290c Update precalculated indicators values 2025-11-12 23:26:12 +07:00
a8f55c80a9 Fix bundle completion 2025-11-12 22:40:58 +07:00
e0d2111553 Fix positions for backtests 2025-11-12 19:45:30 +07:00
583b35d209 Update perf 2025-11-11 14:19:41 +07:00
903413692c Add precalculated signals list + multi scenario test 2025-11-11 14:05:09 +07:00
e810ab60ce Improve backtest run 2025-11-11 13:05:48 +07:00
61fdcec902 perf: remove debug logging and optimize rolling window maintenance (+5.0%) 2025-11-11 12:26:44 +07:00
1792cd2371 Fix backtest consistency 2025-11-11 12:15:12 +07:00
14d101b63e Add benchmark for backtest on the test 2025-11-11 11:23:30 +07:00
14bc98d52d Fix update bundle 2025-11-11 05:47:57 +07:00
8a27155418 Improve a bit workers. bug : Bundle reset after all backtest finish 2025-11-11 05:30:40 +07:00
c6becb032b Improve perf for worker 2025-11-11 04:09:45 +07:00
1d70355617 Optimze worker for backtest 2025-11-11 03:59:41 +07:00
5a4cb670a5 fix executor speed 2025-11-11 03:38:21 +07:00
e8e2ec5a43 Add test for executor 2025-11-11 02:15:57 +07:00
51a227e27e Improve perf for backtests 2025-11-10 02:15:43 +07:00
7dba29c66f Add jobs 2025-11-09 02:08:31 +07:00