Sviluppo TradingBot

This commit is contained in:
2026-06-09 18:29:41 +02:00
parent 61f1e59964
commit e3c0bd51b2
133 changed files with 24903 additions and 1 deletions
+40
View File
@@ -0,0 +1,40 @@
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
}
}