Aggiunta Bootstrap 5.3.3 (CSS, JS, RTL, mappe) al progetto

Sono stati aggiunti tutti i file principali di Bootstrap 5.3.3, inclusi CSS, JavaScript (bundle, ESM, UMD, minificati), versioni RTL, utility, reboot, griglia e relative mappe delle sorgenti. Questi file abilitano un sistema di design moderno, responsive e accessibile, con supporto per layout LTR e RTL, debugging avanzato tramite source map e tutte le funzionalità di Bootstrap per lo sviluppo dell’interfaccia utente. Nessuna modifica ai file esistenti.
This commit is contained in:
2025-12-12 23:27:28 +01:00
parent d50cb1f7b4
commit d25b4443c0
103 changed files with 69677 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
namespace TradingBot.Models;
public class AppSettings
{
public bool SimulationMode { get; set; } = true;
public bool DesktopNotifications { get; set; } = false;
public bool AutoStartBot { get; set; } = true;
public bool ConfirmManualTrades { get; set; } = false;
public int UpdateIntervalSeconds { get; set; } = 3;
public string LogLevel { get; set; } = "Info";
public bool SidebarCollapsed { get; set; } = false;
}

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 }
};
}
}

View File

@@ -0,0 +1,94 @@
namespace TradingBot.Models;
public class AssetStatistics
{
public string Symbol { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
// Trading Performance
public int TotalTrades { get; set; }
public int WinningTrades { get; set; }
public int LosingTrades { get; set; }
public decimal WinRate => TotalTrades > 0 ? (decimal)WinningTrades / TotalTrades * 100 : 0;
// Financial Metrics
public decimal TotalProfit { get; set; }
public decimal TotalLoss { get; set; }
public decimal NetProfit => TotalProfit - TotalLoss;
public decimal ProfitPercentage { get; set; }
public decimal AverageProfit => WinningTrades > 0 ? TotalProfit / WinningTrades : 0;
public decimal AverageLoss => LosingTrades > 0 ? TotalLoss / LosingTrades : 0;
public decimal ProfitFactor => TotalLoss > 0 ? TotalProfit / TotalLoss : TotalProfit > 0 ? decimal.MaxValue : 0;
// Position Information
public decimal CurrentPosition { get; set; }
public decimal AverageEntryPrice { get; set; }
public decimal CurrentPrice { get; set; }
public decimal UnrealizedPnL => CurrentPosition > 0 && AverageEntryPrice > 0
? (CurrentPrice - AverageEntryPrice) * CurrentPosition
: 0;
public decimal UnrealizedPnLPercentage => AverageEntryPrice > 0
? (CurrentPrice - AverageEntryPrice) / AverageEntryPrice * 100
: 0;
// Risk Metrics
public decimal MaxDrawdown { get; set; }
public decimal CurrentDrawdown { get; set; }
public decimal LargestWin { get; set; }
public decimal LargestLoss { get; set; }
public decimal SharpeRatio { get; set; }
// Time-based Metrics
public DateTime? FirstTradeTime { get; set; }
public DateTime? LastTradeTime { get; set; }
public TimeSpan TradingDuration => FirstTradeTime.HasValue && LastTradeTime.HasValue
? LastTradeTime.Value - FirstTradeTime.Value
: TimeSpan.Zero;
// Daily Statistics
public int TradesToday { get; set; }
public decimal ProfitToday { get; set; }
public decimal ProfitTodayPercentage { get; set; }
// Trade Details
public List<Trade> RecentTrades { get; set; } = new();
public List<decimal> EquityCurve { get; set; } = new();
// Strategy Performance
public Dictionary<string, int> TradesByStrategy { get; set; } = new();
public Dictionary<string, decimal> ProfitByStrategy { get; set; } = new();
// Additional Metrics
public decimal AverageTradeSize { get; set; }
public decimal AverageHoldingTime { get; set; } // in hours
public int ConsecutiveWins { get; set; }
public int ConsecutiveLosses { get; set; }
public int MaxConsecutiveWins { get; set; }
public int MaxConsecutiveLosses { get; set; }
}
public class PortfolioStatistics
{
public decimal TotalBalance { get; set; }
public decimal InitialBalance { get; set; }
public decimal TotalProfit => TotalBalance - InitialBalance;
public decimal TotalProfitPercentage => InitialBalance > 0 ? (TotalProfit / InitialBalance) * 100 : 0;
public int TotalAssets { get; set; }
public int ActiveAssets { get; set; }
public int TotalTrades { get; set; }
public decimal WinRate { get; set; }
public decimal BestPerformingAssetProfit { get; set; }
public string BestPerformingAssetSymbol { get; set; } = string.Empty;
public decimal WorstPerformingAssetProfit { get; set; }
public string WorstPerformingAssetSymbol { get; set; } = string.Empty;
public List<AssetStatistics> AssetStatistics { get; set; } = new();
public Dictionary<string, decimal> DailyProfits { get; set; } = new();
public Dictionary<string, int> DailyTrades { get; set; } = new();
public DateTime? StartDate { get; set; }
public DateTime LastUpdateTime { get; set; } = DateTime.UtcNow;
}

View File

@@ -0,0 +1,10 @@
namespace TradingBot.Models;
public class BotStatus
{
public bool IsRunning { get; set; }
public DateTime? StartedAt { get; set; }
public decimal TotalProfit { get; set; }
public int TradesExecuted { get; set; }
public string CurrentStrategy { get; set; } = "Simple Moving Average";
}

View File

@@ -0,0 +1,10 @@
namespace TradingBot.Models;
public class MarketPrice
{
public string Symbol { get; set; } = string.Empty;
public decimal Price { get; set; }
public decimal Change24h { get; set; }
public decimal Volume24h { get; set; }
public DateTime Timestamp { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace TradingBot.Models;
public class Notification
{
public string Message { get; set; } = string.Empty;
public string Type { get; set; } = "info";
}

View File

@@ -0,0 +1,11 @@
namespace TradingBot.Models;
public class TechnicalIndicators
{
public decimal RSI { get; set; }
public decimal MACD { get; set; }
public decimal Signal { get; set; }
public decimal Histogram { get; set; }
public decimal EMA12 { get; set; }
public decimal EMA26 { get; set; }
}

View File

@@ -0,0 +1,19 @@
namespace TradingBot.Models;
public class Trade
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Symbol { get; set; } = string.Empty;
public TradeType Type { get; set; }
public decimal Price { get; set; }
public decimal Amount { get; set; }
public DateTime Timestamp { get; set; }
public string Strategy { get; set; } = string.Empty;
public bool IsBot { get; set; }
}
public enum TradeType
{
Buy,
Sell
}

View File

@@ -0,0 +1,17 @@
namespace TradingBot.Models;
public class TradingSignal
{
public string Symbol { get; set; } = string.Empty;
public SignalType Type { get; set; }
public decimal Price { get; set; }
public string Reason { get; set; } = string.Empty;
public DateTime Timestamp { get; set; }
}
public enum SignalType
{
Buy,
Sell,
Hold
}