Files
Encelado/DesktopBot/Models/TradingSignal.cs
T
2026-06-09 18:29:41 +02:00

41 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using Alpaca.Markets;
namespace DesktopBot.Models
{
/// <summary>
/// Segnale di trading generato da una strategia.
/// </summary>
public class TradingSignal
{
public SignalType Type { get; set; }
public string Symbol { get; set; }
public decimal Price { get; set; }
public DateTime Timestamp { get; set; }
public string Reason { get; set; }
/// <summary>Confidenza del segnale (0100).</summary>
public int Confidence { get; set; }
/// <summary>
/// Livello di Stop Loss calcolato dalla strategia (0 = non impostato,
/// viene usato il default percentuale di BotConfiguration).
/// </summary>
public decimal StopLoss { get; set; }
/// <summary>
/// Livello di Take Profit calcolato dalla strategia (0 = non impostato).
/// </summary>
public decimal TakeProfit { get; set; }
/// <summary>Lato dell'ordine Alpaca derivato dal tipo di segnale.</summary>
public OrderSide Side => Type == SignalType.Sell ? OrderSide.Sell : OrderSide.Buy;
}
public enum SignalType
{
None,
Buy,
Sell,
Hold
}
}