Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-08-05 10:05:20 +02:00
parent 61f1e59964
commit f96ed670ca
239 changed files with 23858 additions and 730 deletions
+45
View File
@@ -0,0 +1,45 @@
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 }
};
}
}