Commit Graph

162 Commits

Author SHA1 Message Date
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
f81a2da9df Fix tests 2025-11-26 18:42:02 +07:00
3802187155 Update BB volume protection 2025-11-25 12:04:26 +07:00
4b5c1c5ce0 Fix graph 2025-11-25 11:03:52 +07:00
6376e13b07 Add Bollinger Bands Volatility Protection indicator support
- Introduced BollingerBandsVolatilityProtection indicator in GeneticService with configuration settings for period and standard deviation (stdev).
- Updated ScenarioHelpers to handle creation and validation of the new indicator type.
- Enhanced CustomScenario, backtest, and scenario pages to include BollingerBandsVolatilityProtection in indicator lists and parameter mappings.
- Modified API and types to reflect the addition of the new indicator in relevant enums and mappings.
- Updated frontend components to support new parameters and visualization for Bollinger Bands.
2025-11-25 02:12:57 +07:00
4b33b01707 Update ichimoku 2025-11-24 20:02:14 +07:00
4268626897 Add IchimokuKumoTrend indicator support across application
- Introduced IchimokuKumoTrend indicator in GeneticService with configuration settings for tenkanPeriods, kijunPeriods, senkouBPeriods, offsetPeriods, senkouOffset, and chikouOffset.
- Updated ScenarioHelpers to handle creation and validation of the new indicator type.
- Enhanced CustomScenario, backtest, and scenario pages to include IchimokuKumoTrend in indicator lists and parameter mappings.
- Modified API and types to reflect the addition of the new indicator in relevant enums and mappings.
2025-11-24 19:43:18 +07:00
478dca51e7 Add BollingerBandsPercentBMomentumBreakout indicator support across application
- Introduced BollingerBandsPercentBMomentumBreakout indicator in GeneticService with configuration settings for period and multiplier.
- Updated ScenarioHelpers to handle creation and validation of the new indicator type.
- Enhanced CustomScenario, backtest, and scenario pages to include BollingerBandsPercentBMomentumBreakout in indicator lists and parameter mappings.
- Modified API and types to reflect the addition of the new indicator in relevant enums and mappings.
2025-11-24 17:31:17 +07:00
43d7c5c929 Add StochasticCross indicator support in GeneticService and related classes
- Introduced StochasticCross indicator type in GeneticService with configuration settings for stochPeriods, signalPeriods, smoothPeriods, kFactor, and dFactor.
- Updated IIndicator interface and IndicatorBase class to include KFactor and DFactor properties.
- Enhanced LightIndicator class to support new properties and ensure proper conversion back to full Indicator.
- Modified ScenarioHelpers to handle StochasticCross indicator creation and validation, ensuring default values and error handling for kFactor and dFactor.
2025-11-24 10:39:53 +07:00
411fc41bef Refactor BotController and BotService for improved bot management
- Cleaned up constructor parameters in BotController for better readability.
- Enhanced StartCopyTradingCommand handling with improved formatting.
- Updated bot deletion logic in BotService to delete associated positions and trigger agent summary updates.
- Added new method in TradingService for deleting positions by initiator identifier.
- Implemented error handling in StopBotCommandHandler to ensure agent summary updates do not disrupt bot stop operations.
2025-11-23 15:30:11 +07:00
b1aa0541e2 Add test and max collateral used 2025-11-20 15:38:27 +07:00
ff2df2d9ac Add MasterBotUserId and MasterAgentName for copy trading support
- Introduced MasterBotUserId and MasterAgentName properties to facilitate copy trading functionality.
- Updated relevant models, controllers, and database entities to accommodate these new properties.
- Enhanced validation logic in StartCopyTradingCommandHandler to ensure proper ownership checks for master strategies.
2025-11-20 00:33:31 +07:00
f56d75d28f Fix loop when trying to recover the cancelled position 2025-11-19 20:23:44 +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
02e46e8d0d Add paginated user retrieval functionality in AdminController and related services. Implemented UsersFilter for filtering user queries and added LastConnectionDate property to User model. Updated database schema and frontend API to support new user management features. 2025-11-17 20:04:17 +07:00
06ef33b7ab Enhance user authentication by adding optional OwnerWalletAddress parameter in LoginRequest and UserService. Update UserController and related components to support the new wallet address functionality, ensuring better user profile management and validation in trading operations. 2025-11-17 13:48:05 +07:00
1e15d5f23b Add copy trading functionality with StartCopyTrading endpoint and related models. Implemented position copying from master bot and subscription to copy trading stream in LiveTradingBotGrain. Updated TradingBotConfig to support copy trading parameters. 2025-11-16 14:54:17 +07:00
49a693b44a Remove orderBy to improve perfs 2025-11-15 14:17:21 +07:00
6d661f459e Remove candle from backtest return + fix message when good backtest 2025-11-14 20:49:02 +07:00
b60295fcb2 Add test for dailysnapshot 2025-11-14 19:42:52 +07:00
d27df5de51 Add test for platform summary calculation 2025-11-14 17:21:39 +07:00
a6ae3a971c Rename finalPnl to netPnl in tradinbox for ROI 2025-11-14 14:37:32 +07:00
d341ee05c9 Add more tests + Log pnl for each backtest 2025-11-14 13:12:04 +07:00
2548e9b757 Fix all tests 2025-11-14 04:03:00 +07:00
0831cf2ca0 Improve tests logic 2025-11-14 03:18:11 +07:00
b712cf8fc3 Fix test for trading metrics 2025-11-14 03:04:09 +07:00
460a7bd559 Fix realized pnl on backtest save + add tests (not all passing) 2025-11-14 02:38:15 +07:00
3b176c290c Update precalculated indicators values 2025-11-12 23:26:12 +07:00
e0d2111553 Fix positions for backtests 2025-11-12 19:45:30 +07:00
46966cc5d8 perf: optimize TradingBotBase and TradingBox - reduce LINQ overhead and allocations (+31.1%) 2025-11-11 12:21:50 +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
1d70355617 Optimze worker for backtest 2025-11-11 03:59:41 +07:00
0861e9a8d2 Add admin page for bundle 2025-11-10 11:50:20 +07:00
51a227e27e Improve perf for backtests 2025-11-10 02:15:43 +07:00
7e08e63dd1 Add genetic backtest to worker 2025-11-09 03:32:08 +07:00
7dba29c66f Add jobs 2025-11-09 02:08:31 +07:00
e0795677e4 Add whitelisting and admin 2025-11-07 23:46:48 +07:00
21110cd771 Add whitelisting service + update the jwt valid audience 2025-11-07 19:38:33 +07:00
38e6998ff3 Add test to check if backtest behavior changed 2025-10-24 19:08:10 +07:00
92c28367cf Add Versionning for bundle backtest request 2025-10-23 13:37:53 +07:00
a1fe7ed3b3 Add saved bundle status 2025-10-22 16:45:49 +07:00
d6122aeb27 Fix backtests and indicators 2025-10-16 20:06:47 +07:00
472c507801 Add netpnl and initialBalance to backtests 2025-10-16 17:19:22 +07:00
1dcd562cf8 Fix backtests 2025-10-16 00:47:55 +07:00
e9479e0a48 Add logs when running signal 2025-10-15 22:01:32 +07:00
74adad5834 Add filters and sorting for backtests 2025-10-14 18:06:36 +07:00
30fccc3644 Remove required from the accountName 2025-10-12 16:18:01 +07:00
32ac342a20 Update bundle backtests 2025-10-12 15:42:38 +07:00