Fix bot update with the tradingtype
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using Managing.Api.Models.Requests;
|
using Managing.Api.Models.Requests;
|
||||||
using Managing.Api.Models.Responses;
|
using Managing.Api.Models.Responses;
|
||||||
using Managing.Application.Abstractions;
|
using Managing.Application.Abstractions;
|
||||||
using Managing.Application.Abstractions.Services;
|
using Managing.Application.Abstractions.Services;
|
||||||
@@ -544,6 +544,7 @@ public class BotController : BaseController
|
|||||||
StartupTime = item.StartupTime,
|
StartupTime = item.StartupTime,
|
||||||
Name = item.Name,
|
Name = item.Name,
|
||||||
Ticker = item.Ticker,
|
Ticker = item.Ticker,
|
||||||
|
TradingType = item.TradingType,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Managing.Api.Models.Requests;
|
using Managing.Api.Models.Requests;
|
||||||
using Managing.Api.Models.Responses;
|
using Managing.Api.Models.Responses;
|
||||||
using Managing.Application.Abstractions;
|
using Managing.Application.Abstractions;
|
||||||
using Managing.Application.Abstractions.Grains;
|
using Managing.Application.Abstractions.Grains;
|
||||||
@@ -1032,6 +1032,7 @@ public class DataController : ControllerBase
|
|||||||
StartupTime = item.StartupTime,
|
StartupTime = item.StartupTime,
|
||||||
Name = item.Name,
|
Name = item.Name,
|
||||||
Ticker = item.Ticker,
|
Ticker = item.Ticker,
|
||||||
|
TradingType = item.TradingType,
|
||||||
MasterAgentName = item.MasterBotUser?.AgentName,
|
MasterAgentName = item.MasterBotUser?.AgentName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1015,6 +1015,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
|||||||
Identifier = _state.State.Identifier,
|
Identifier = _state.State.Identifier,
|
||||||
Name = _state.State.Config.Name,
|
Name = _state.State.Config.Name,
|
||||||
Ticker = _state.State.Config.Ticker,
|
Ticker = _state.State.Config.Ticker,
|
||||||
|
TradingType = _state.State.Config.TradingType,
|
||||||
User = _state.State.User,
|
User = _state.State.User,
|
||||||
Status = status,
|
Status = status,
|
||||||
CreateDate = _state.State.CreateDate,
|
CreateDate = _state.State.CreateDate,
|
||||||
@@ -1073,6 +1074,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
|||||||
Identifier = _state.State.Identifier,
|
Identifier = _state.State.Identifier,
|
||||||
Name = _state.State.Config.Name,
|
Name = _state.State.Config.Name,
|
||||||
Ticker = _state.State.Config.Ticker,
|
Ticker = _state.State.Config.Ticker,
|
||||||
|
TradingType = _state.State.Config.TradingType,
|
||||||
User = _state.State.User,
|
User = _state.State.User,
|
||||||
Status = status,
|
Status = status,
|
||||||
StartupTime = _state.State.StartupTime,
|
StartupTime = _state.State.StartupTime,
|
||||||
|
|||||||
@@ -374,7 +374,8 @@ namespace Managing.Application.ManageBot
|
|||||||
|| existingBot.AccumulatedRunTimeSeconds != bot.AccumulatedRunTimeSeconds
|
|| existingBot.AccumulatedRunTimeSeconds != bot.AccumulatedRunTimeSeconds
|
||||||
|| existingBot.LastStartTime != bot.LastStartTime
|
|| existingBot.LastStartTime != bot.LastStartTime
|
||||||
|| existingBot.LastStopTime != bot.LastStopTime
|
|| existingBot.LastStopTime != bot.LastStopTime
|
||||||
|| existingBot.Ticker != bot.Ticker)
|
|| existingBot.Ticker != bot.Ticker
|
||||||
|
|| existingBot.TradingType != bot.TradingType)
|
||||||
{
|
{
|
||||||
_tradingBotLogger.LogInformation("Update bot statistics for bot {BotId}",
|
_tradingBotLogger.LogInformation("Update bot statistics for bot {BotId}",
|
||||||
bot.Identifier);
|
bot.Identifier);
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public class PostgreSqlBotRepository : IBotRepository
|
|||||||
// Update the existing entity properties directly instead of creating a new one
|
// Update the existing entity properties directly instead of creating a new one
|
||||||
existingEntity.Name = bot.Name;
|
existingEntity.Name = bot.Name;
|
||||||
existingEntity.Ticker = bot.Ticker;
|
existingEntity.Ticker = bot.Ticker;
|
||||||
|
existingEntity.TradingType = bot.TradingType;
|
||||||
existingEntity.Status = bot.Status;
|
existingEntity.Status = bot.Status;
|
||||||
existingEntity.StartupTime = bot.StartupTime;
|
existingEntity.StartupTime = bot.StartupTime;
|
||||||
existingEntity.TradeWins = bot.TradeWins;
|
existingEntity.TradeWins = bot.TradeWins;
|
||||||
|
|||||||
@@ -638,6 +638,7 @@ export interface LightBacktestResponse {
|
|||||||
initialBalance: number;
|
initialBalance: number;
|
||||||
netPnl: number;
|
netPnl: number;
|
||||||
positionCount: number;
|
positionCount: number;
|
||||||
|
tradingType: TradingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PaginatedBacktestsResponse {
|
export interface PaginatedBacktestsResponse {
|
||||||
|
|||||||
@@ -5137,6 +5137,7 @@ export interface LightBacktestResponse {
|
|||||||
initialBalance: number;
|
initialBalance: number;
|
||||||
netPnl: number;
|
netPnl: number;
|
||||||
positionCount: number;
|
positionCount: number;
|
||||||
|
tradingType: TradingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PaginatedBacktestsResponse {
|
export interface PaginatedBacktestsResponse {
|
||||||
|
|||||||
@@ -638,6 +638,7 @@ export interface LightBacktestResponse {
|
|||||||
initialBalance: number;
|
initialBalance: number;
|
||||||
netPnl: number;
|
netPnl: number;
|
||||||
positionCount: number;
|
positionCount: number;
|
||||||
|
tradingType: TradingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PaginatedBacktestsResponse {
|
export interface PaginatedBacktestsResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user