Files
managing-apps/src/Managing.Api/Models/Responses/TradingBotResponse.cs
cryptooda 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

90 lines
2.5 KiB
C#

using System.ComponentModel.DataAnnotations;
using Managing.Domain.Candles;
using Managing.Domain.Indicators;
using Managing.Domain.Trades;
using static Managing.Common.Enums;
namespace Managing.Api.Models.Responses
{
public class TradingBotResponse
{
/// <summary>
/// Current status of the bot (Up, Down, etc.)
/// </summary>
[Required]
public string Status { get; internal set; }
/// <summary>
/// Dictionary of signals generated by the bot, keyed by signal identifier
/// </summary>
[Required]
public Dictionary<string, LightSignal> Signals { get; internal set; }
/// <summary>
/// Dictionary of positions opened by the bot, keyed by position identifier
/// </summary>
[Required]
public Dictionary<Guid, Position> Positions { get; internal set; }
/// <summary>
/// Candles used by the bot for analysis
/// </summary>
[Required]
public List<Candle> Candles { get; internal set; }
/// <summary>
/// Current win rate percentage
/// </summary>
[Required]
public int WinRate { get; internal set; }
/// <summary>
/// Current profit and loss
/// </summary>
[Required]
public decimal ProfitAndLoss { get; internal set; }
/// <summary>
/// Current return on investment percentage
/// </summary>
[Required]
public decimal Roi { get; internal set; }
/// <summary>
/// Unique identifier for the bot
/// </summary>
[Required]
public string Identifier { get; set; }
/// <summary>
/// Agent name associated with the bot
/// </summary>
[Required]
public string AgentName { get; set; }
/// <summary>
/// The time when the bot was created
/// </summary>
[Required]
public DateTime CreateDate { get; internal set; }
/// <summary>
/// The time when the bot was started
/// </summary>
[Required]
public DateTime StartupTime { get; internal set; }
[Required] public string Name { get; set; }
/// <summary>
/// The ticker/symbol being traded by this bot
/// </summary>
[Required]
public Ticker Ticker { get; set; }
/// <summary>
/// The agent name of the master bot's owner (for copy trading bots)
/// </summary>
public string MasterAgentName { get; set; }
}
}