namespace TradingBot.Models;
///
/// Represents the mapping between an asset and its assigned trading strategies
///
public class AssetStrategyMapping
{
public string Symbol { get; set; } = string.Empty;
public string AssetName { get; set; } = string.Empty;
public List StrategyIds { get; set; } = new();
public bool IsActive { get; set; }
public DateTime ActivatedAt { get; set; }
public DateTime? DeactivatedAt { get; set; }
///
/// Strategy-specific parameters override
/// Key: StrategyId, Value: Dictionary of parameter names and values
///
public Dictionary> StrategyParameters { get; set; } = new();
}
///
/// Represents a trading strategy instance
///
public class StrategyInfo
{
public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty; // Trend, Oscillator, Volatility, etc.
public StrategyRisk RiskLevel { get; set; }
public TimeFrame RecommendedTimeFrame { get; set; }
public List RequiredIndicators { get; set; } = new();
public Dictionary Parameters { get; set; } = new();
}
///
/// Parameter information for strategy configuration
///
public class ParameterInfo
{
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public ParameterType Type { get; set; }
public object DefaultValue { get; set; } = 0;
public object? MinValue { get; set; }
public object? MaxValue { get; set; }
}
///
/// Trading engine status for an asset
///
public class TradingEngineStatus
{
public string Symbol { get; set; } = string.Empty;
public bool IsRunning { get; set; }
public int ActiveStrategies { get; set; }
public DateTime? LastSignalTime { get; set; }
public List RecentSignals { get; set; } = new();
public TradingDecision? LastDecision { get; set; }
}
///
/// Signal from a specific strategy
///
public class StrategySignal
{
public string StrategyId { get; set; } = string.Empty;
public string StrategyName { get; set; } = string.Empty;
public TradingSignal Signal { get; set; } = new();
public DateTime GeneratedAt { get; set; } = DateTime.UtcNow;
}
///
/// Aggregated trading decision from multiple strategies
///
public class TradingDecision
{
public string Symbol { get; set; } = string.Empty;
public SignalType Decision { get; set; }
public decimal Confidence { get; set; }
public string Reason { get; set; } = string.Empty;
public int BuyVotes { get; set; }
public int SellVotes { get; set; }
public int HoldVotes { get; set; }
public List SupportingStrategies { get; set; } = new();
public List OpposingStrategies { get; set; } = new();
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}
///
/// Strategy performance metrics
///
public class StrategyPerformance
{
public string StrategyId { get; set; } = string.Empty;
public string Symbol { get; set; } = string.Empty;
public int TotalSignals { get; set; }
public int CorrectSignals { get; set; }
public decimal Accuracy { get; set; }
public decimal TotalProfit { get; set; }
public decimal AverageConfidence { get; set; }
public DateTime FirstSignalTime { get; set; }
public DateTime LastSignalTime { get; set; }
}
///
/// Risk level for strategies
///
public enum StrategyRisk
{
Low,
Medium,
High,
VeryHigh
}
///
/// Recommended time frame for strategy
///
public enum TimeFrame
{
ShortTerm, // Minutes to hours
MediumTerm, // Hours to days
LongTerm // Days to weeks
}
///
/// Parameter data type
///
public enum ParameterType
{
Integer,
Decimal,
Boolean,
String
}