namespace TradingBot.Models;

public class AssetConfiguration
{
    public string Symbol { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public bool IsEnabled { get; set; }
    public decimal InitialBalance { get; set; } = 1000m;
    public decimal CurrentBalance { get; set; } = 1000m;
    public decimal CurrentHoldings { get; set; }
    public decimal AverageEntryPrice { get; set; }
    
    // Strategy Settings
    public string StrategyName { get; set; } = "Simple Moving Average";
    public Dictionary<string, object> StrategyParameters { get; set; } = new();
    
    // Risk Management
    public decimal MaxPositionSize { get; set; } = 100m;
    public decimal StopLossPercentage { get; set; } = 5m;
    public decimal TakeProfitPercentage { get; set; } = 10m;
    
    // Trading Constraints
    public decimal MinTradeAmount { get; set; } = 10m;
    public decimal MaxTradeAmount { get; set; } = 500m;
    public int MaxDailyTrades { get; set; } = 10;
    
    // Current State
    public DateTime? LastTradeTime { get; set; }
    public int DailyTradeCount { get; set; }
    public DateTime DailyTradeCountReset { get; set; } = DateTime.UtcNow.Date;
    
    // Statistics Quick Access
    public decimal TotalProfit => CurrentBalance + (CurrentHoldings * AverageEntryPrice) - InitialBalance;
    public decimal ProfitPercentage => InitialBalance > 0 ? (TotalProfit / InitialBalance) * 100 : 0;
    
    public AssetConfiguration()
    {
        StrategyParameters = new Dictionary<string, object>
        {
            { "ShortPeriod", 10 },
            { "LongPeriod", 30 },
            { "SignalThreshold", 0.5m }
        };
    }
}
