- Sidebar portfolio con metriche dettagliate (Totale, Investito, Disponibile, P&L, ROI) e aggiornamento real-time - Sistema multi-strategia: 8 strategie assegnabili per asset, voting decisionale, pagina Trading Control - Nuova pagina Posizioni: gestione, chiusura manuale, P&L non realizzato, notifiche - Sistema indicatori tecnici: 7+ indicatori configurabili, segnali real-time, raccomandazioni, storico segnali - Refactoring TradingBotService per capitale, P&L, ROI, eventi - Nuovi modelli e servizi per strategie/indicatori, persistenza configurazioni - UI/UX: navigazione aggiornata, widget, modali, responsive - Aggiornamento README e CHANGELOG con tutte le novità
95 lines
2.6 KiB
C#
95 lines
2.6 KiB
C#
namespace TradingBot.Models;
|
|
|
|
/// <summary>
|
|
/// Configuration for a trading indicator
|
|
/// </summary>
|
|
public class IndicatorConfig
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public IndicatorType Type { get; set; }
|
|
public bool IsEnabled { get; set; } = true;
|
|
|
|
// Thresholds for signals
|
|
public decimal? OverboughtThreshold { get; set; }
|
|
public decimal? OversoldThreshold { get; set; }
|
|
public decimal? BuyThreshold { get; set; }
|
|
public decimal? SellThreshold { get; set; }
|
|
|
|
// Indicator-specific parameters
|
|
public int Period { get; set; } = 14;
|
|
public int FastPeriod { get; set; } = 12;
|
|
public int SlowPeriod { get; set; } = 26;
|
|
public int SignalPeriod { get; set; } = 9;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Real-time indicator signal
|
|
/// </summary>
|
|
public class IndicatorSignal
|
|
{
|
|
public string IndicatorId { get; set; } = string.Empty;
|
|
public string IndicatorName { get; set; } = string.Empty;
|
|
public string Symbol { get; set; } = string.Empty;
|
|
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
|
|
public SignalStrength Strength { get; set; }
|
|
public SignalType Type { get; set; }
|
|
public string Message { get; set; } = string.Empty;
|
|
public decimal? Value { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Indicator status for a specific asset
|
|
/// </summary>
|
|
public class IndicatorStatus
|
|
{
|
|
public string IndicatorId { get; set; } = string.Empty;
|
|
public string Symbol { get; set; } = string.Empty;
|
|
public decimal CurrentValue { get; set; }
|
|
public decimal? PreviousValue { get; set; }
|
|
public MarketCondition Condition { get; set; }
|
|
public string Recommendation { get; set; } = string.Empty;
|
|
public DateTime LastUpdate { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Types of trading indicators
|
|
/// </summary>
|
|
public enum IndicatorType
|
|
{
|
|
RSI, // Relative Strength Index
|
|
MACD, // Moving Average Convergence Divergence
|
|
SMA, // Simple Moving Average
|
|
EMA, // Exponential Moving Average
|
|
BollingerBands, // Bollinger Bands
|
|
Stochastic, // Stochastic Oscillator
|
|
Volume, // Volume indicators
|
|
ATR // Average True Range (volatility)
|
|
}
|
|
|
|
/// <summary>
|
|
/// Signal strength levels
|
|
/// </summary>
|
|
public enum SignalStrength
|
|
{
|
|
Weak,
|
|
Moderate,
|
|
Strong,
|
|
VeryStrong
|
|
}
|
|
|
|
/// <summary>
|
|
/// Market condition based on indicators
|
|
/// </summary>
|
|
public enum MarketCondition
|
|
{
|
|
Neutral,
|
|
Overbought,
|
|
Oversold,
|
|
Bullish,
|
|
Bearish,
|
|
Ranging,
|
|
Trending
|
|
}
|