Commit Graph

1130 Commits

Author SHA1 Message Date
18f868a221 Add StochasticCross indicator support in CustomScenario and TradeChart components
- Implemented StochasticCross indicator in CustomScenario with associated parameters and labels.
- Enhanced TradeChart to visualize StochasticCross data, including %K and %D series.
- Updated API and types to include kFactor and dFactor properties for StochasticCross.
- Modified backtest and scenario pages to incorporate StochasticCross in indicator lists and parameter mappings.
2025-11-24 11:04:05 +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
ad3b3f2fa5 Add command for adding indicators 2025-11-24 10:05:16 +07:00
9e3d8c74b9 Remove some logs from db 2025-11-24 01:26:10 +07:00
fef66f6d7b Update configuration settings and logging behavior for SQL monitoring
- Increased thresholds for maximum query and method executions per window to 500 and 250, respectively, to reduce false positives in loop detection.
- Enabled logging of slow queries only, improving performance by reducing log volume.
- Adjusted SQL query logging to capture only warnings and errors, further optimizing logging efficiency.
- Updated various settings across appsettings files to reflect these changes, ensuring consistency in configuration.
2025-11-24 01:02:53 +07:00
372d19f840 Refactor welcome message handling to UserService for Telegram channel updates
- Moved the welcome message logic from UserController to UserService to centralize user notification handling.
- Improved error logging for message sending failures, ensuring better traceability of issues.
- Enhanced user experience by maintaining the detailed setup information and friendly greeting in the welcome message.
2025-11-24 00:43:58 +07:00
220ca66546 Update welcome message format in UserController for Kaigen Notifications
- Revised the welcome message sent to users upon Telegram channel configuration to enhance clarity and engagement.
- Included detailed setup information and a friendly greeting to improve user experience.
- Updated notification types to reflect the new features and services provided by the Kaigen notification system.
2025-11-24 00:37:07 +07:00
4e797c615b Enhance Telegram channel validation in UserService and Formatings
- Updated UpdateTelegramChannel method to support both numeric channel IDs and Telegram URL formats.
- Improved error handling for invalid formats, ensuring clear exceptions for users.
- Refactored Formatings class to extract numeric channel IDs from URLs and handle formatting consistently.
2025-11-24 00:23:42 +07:00
47bea1b9b7 Update closing position on BotStop 2025-11-23 23:31:34 +07:00
6429501b70 Add more logs for auto-close on owned keys 2025-11-23 22:57:30 +07:00
c7c89c903f Enhance error handling and logging in BotController, LiveTradingBotGrain, and BotService
- Added specific handling for ServiceUnavailableException in BotController to return user-friendly messages.
- Improved logging for Orleans exceptions in both BotController and BotService to provide clearer context during errors.
- Implemented verification of position closure status in LiveTradingBotGrain, including timeout handling for closing positions.
- Enhanced logging for critical and non-critical operations during bot stop processes to ensure better traceability.
2025-11-23 21:49:23 +07:00
d10ce5e3ba Enhance error handling and logging in BotController, LiveTradingBotGrain, and BotService
- Added specific handling for ServiceUnavailableException in BotController to return user-friendly messages.
- Improved logging for Orleans exceptions in both BotController and BotService to provide clearer context during errors.
- Implemented verification of position closure status in LiveTradingBotGrain, including timeout handling for closing positions.
- Enhanced logging for critical and non-critical operations during bot stop processes to ensure better traceability.
2025-11-23 21:48:21 +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
9c8ab71736 Do not update the masterBotUserId if update change it to null 2025-11-22 16:32:00 +07:00
461a73a8e3 Add MasterBot configuration properties to TradingBotBase and ensure MasterBotUserId preservation in RestartBotCommandHandler
- Introduced IsForCopyTrading, MasterBotIdentifier, and MasterBotUserId properties in TradingBotBase for enhanced bot configuration.
- Updated RestartBotCommandHandler to preserve MasterBotUserId from the database bot configuration.
2025-11-22 15:42:17 +07:00
bd4d6be8d9 Fix restart bot without account 2025-11-22 15:27:43 +07:00
2a354bd7d2 Implement profitable bots filtering in BotController and DataController
- Added IConfiguration dependency to BotController for accessing environment variables.
- Updated GetBotsPaginatedAsync method in BotService and IBotService to include a flag for filtering profitable bots.
- Modified DataController to utilize the new filtering option for agent summaries and bot retrieval.
- Enhanced PostgreSqlBotRepository to apply filtering based on profitability when querying bots.
2025-11-22 14:02:29 +07:00
e69dd43ace Enhance DataController and BotService with new configuration and bot name checks
- Added IConfiguration dependency to DataController for environment variable access.
- Updated GetPaginatedAgentSummariesCommand to include a flag for filtering profitable agents.
- Implemented HasUserBotWithNameAsync method in IBotService and BotService to check for existing bots by name.
- Modified StartBotCommandHandler and StartCopyTradingCommandHandler to prevent duplicate bot names during strategy creation.
2025-11-22 13:34:26 +07:00
269bbfaab0 Add GetBotByUserIdAndNameAsync method to IBotService and BotService
- Implemented GetBotByUserIdAndNameAsync in IBotService and BotService to retrieve a bot by user ID and name.
- Updated GetUserStrategyCommandHandler to utilize the new method for fetching strategies based on user ID.
- Added corresponding method in IBotRepository and PostgreSqlBotRepository for database access.
2025-11-22 10:46:07 +07:00
476bcebfe9 Fix active strategy count on plateform surmmary 2025-11-21 20:02:33 +07:00
153e170ca4 Refactor LiveBotRegistryGrain and PlatformSummaryGrain to improve active bot tracking
- Introduced CalculateActiveBotsCount method in LiveBotRegistryGrain to streamline active bot count calculations.
- Updated logging to reflect active bot counts accurately during registration and unregistration.
- Added historical tracking of strategy activation/deactivation events in PlatformSummaryGrain, including a new StrategyEvent class and related logic to manage event history.
- Enhanced CalculateActiveStrategiesForDate method to compute active strategies based on historical events.
2025-11-21 19:38:32 +07:00
eac13dd5e4 Enhance bot command handlers with GMX wallet initialization
- Updated RestartBotCommandHandler, StartBotCommandHandler, and StartCopyTradingCommandHandler to include ITradingService for GMX wallet initialization.
- Added checks for GMX account initialization status and implemented wallet initialization logic where necessary.
- Improved error handling for wallet initialization failures.
2025-11-21 19:05:51 +07:00
53f81302ba Return last 24 volume for strategies 2025-11-21 17:02:18 +07:00
1bec83a2ec Add MasterAgentName to UserStrategyDetailsViewModel and DataController
- Updated UserStrategyDetailsViewModel to include MasterAgentName property, which represents the agent name of the master bot's owner for copy trading bots.
- Modified DataController to populate the MasterAgentName field when returning strategy details.
2025-11-21 14:28:19 +07:00
d3623350da Save bundle backtest 2025-11-20 23:25:43 +07:00
aa8a723aad Dont display indicators use on copied strategy 2025-11-20 22:14:44 +07:00
4d4e5b6d25 Update position value calculations in AgentGrain and BotService
- Changed the calculation of USDC value in AgentGrain to use net profit and loss instead of realized profit.
- Added similar position value calculations in BotService, including error handling for position retrieval failures.
2025-11-20 20:34:12 +07:00
a6adf5e458 Fix test with new ROI and collateral calcul 2025-11-20 20:04:20 +07:00
b1aa0541e2 Add test and max collateral used 2025-11-20 15:38:27 +07:00
55f70add44 Include master bot for all query on Botentity 2025-11-20 14:52:55 +07:00
190a9cf12d Finish copy trading 2025-11-20 14:46:54 +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
97103fbfe8 Add master strategy validation in LiveTradingBotGrain
- Introduced a check to ensure the master strategy is retrieved successfully before proceeding with key validation.
- Added logging for cases where the master strategy is not found, improving traceability in the bot's operation.
2025-11-19 23:39:38 +07:00
fb570b9f7e Fix key conditions 2025-11-19 23:25:57 +07:00
b7796ede0c Add logging for owned keys in KaigenService
- Enhanced logging to include the count of owned keys fetched for a user.
- Added detailed logging for each owned key's agent name.
2025-11-19 23:18:56 +07:00
799b27b0a8 Remove credit have to be enable for owned keys 2025-11-19 21:12:25 +07:00
c7adb687b8 Fix recovery positions 2025-11-19 21:06:02 +07:00
e1f2f75c23 Fix redundant recover position call 2025-11-19 20:42:11 +07:00
f56d75d28f Fix loop when trying to recover the cancelled position 2025-11-19 20:23:44 +07:00
61f95981a7 Fix position count 2025-11-19 17:58:04 +07:00
096fb500e4 Add position count property map 2025-11-19 14:16:30 +07:00
9b25201def Remove SSL for kaigen API url 2025-11-19 09:08:58 +07:00
6db2b34f9f Update influxdb api key 2025-11-19 09:01:53 +07:00
3236edd2bb Add Kaigen API health check and configuration
- Introduced Kaigen configuration section in appsettings.Oda.json with BaseUrl.
- Added HTTP client for Kaigen API health check in Program.cs.
- Registered KaigenHealthCheck service for monitoring Kaigen API connectivity.
2025-11-19 00:59:49 +07:00
5176e41583 Add apply migration and rollback from backup 2025-11-18 23:41:16 +07:00
030a6b0eba Fix bot running signal 2025-11-18 23:02:38 +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
0ee190786e Prevent user to open multiple strategy on the same ticker 2025-11-18 13:58:50 +07:00
87712038ff Update configs 2025-11-18 11:23:21 +07:00
6341d712ef Update Config local to remote name 2025-11-18 11:00:01 +07:00