Add min and max balance filters to bot management
- Introduced optional parameters for minimum and maximum BotTradingBalance in BotController, DataController, and related services. - Updated interfaces and repository methods to support filtering by BotTradingBalance. - Enhanced TradingBotResponse and BotEntity models to include BotTradingBalance property. - Adjusted database schema to accommodate new BotTradingBalance field. - Ensured proper mapping and handling of BotTradingBalance in PostgreSQL repository and mappers.
This commit is contained in:
@@ -46,6 +46,8 @@ public interface IBotService
|
||||
/// <param name="name">Filter by name (partial match, case-insensitive)</param>
|
||||
/// <param name="ticker">Filter by ticker (partial match, case-insensitive)</param>
|
||||
/// <param name="agentName">Filter by agent name (partial match, case-insensitive)</param>
|
||||
/// <param name="minBalance">Filter by minimum BotTradingBalance (optional)</param>
|
||||
/// <param name="maxBalance">Filter by maximum BotTradingBalance (optional)</param>
|
||||
/// <param name="sortBy">Sort field</param>
|
||||
/// <param name="sortDirection">Sort direction</param>
|
||||
/// <param name="showOnlyProfitable">Whether to show only profitable bots (ROI > 0)</param>
|
||||
@@ -57,6 +59,8 @@ public interface IBotService
|
||||
string? name = null,
|
||||
string? ticker = null,
|
||||
string? agentName = null,
|
||||
decimal? minBalance = null,
|
||||
decimal? maxBalance = null,
|
||||
BotSortableColumn sortBy = BotSortableColumn.CreateDate,
|
||||
SortDirection sortDirection = SortDirection.Desc,
|
||||
bool showOnlyProfitable = false);
|
||||
|
||||
@@ -1062,6 +1062,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
||||
Roi = 0,
|
||||
Volume = 0,
|
||||
Fees = 0,
|
||||
BotTradingBalance = _state.State.Config.BotTradingBalance,
|
||||
MasterBotUserId = _state.State.Config.MasterBotUserId
|
||||
};
|
||||
}
|
||||
@@ -1127,6 +1128,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
||||
Fees = agentMetrics.TotalFees,
|
||||
LongPositionCount = longPositionCount,
|
||||
ShortPositionCount = shortPositionCount,
|
||||
BotTradingBalance = _state.State.Config.BotTradingBalance,
|
||||
MasterBotUserId = _state.State.Config.MasterBotUserId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -375,7 +375,8 @@ namespace Managing.Application.ManageBot
|
||||
|| existingBot.LastStartTime != bot.LastStartTime
|
||||
|| existingBot.LastStopTime != bot.LastStopTime
|
||||
|| existingBot.Ticker != bot.Ticker
|
||||
|| existingBot.TradingType != bot.TradingType)
|
||||
|| existingBot.TradingType != bot.TradingType
|
||||
|| existingBot.BotTradingBalance != Math.Round(bot.BotTradingBalance, 8))
|
||||
{
|
||||
_tradingBotLogger.LogInformation("Update bot statistics for bot {BotId}",
|
||||
bot.Identifier);
|
||||
@@ -486,6 +487,8 @@ namespace Managing.Application.ManageBot
|
||||
string? name = null,
|
||||
string? ticker = null,
|
||||
string? agentName = null,
|
||||
decimal? minBalance = null,
|
||||
decimal? maxBalance = null,
|
||||
BotSortableColumn sortBy = BotSortableColumn.CreateDate,
|
||||
SortDirection sortDirection = SortDirection.Desc,
|
||||
bool showOnlyProfitable = false)
|
||||
@@ -501,6 +504,8 @@ namespace Managing.Application.ManageBot
|
||||
name,
|
||||
ticker,
|
||||
agentName,
|
||||
minBalance,
|
||||
maxBalance,
|
||||
sortBy,
|
||||
sortDirection,
|
||||
showOnlyProfitable);
|
||||
|
||||
Reference in New Issue
Block a user