79 lines
2.1 KiB
C#
79 lines
2.1 KiB
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace FinlyticBot.Entities;
|
|
|
|
[Table("ExecutedPaperTrades")]
|
|
public class ExecutedPaperTradeEntity
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
[Required]
|
|
[MaxLength(100)]
|
|
public string TradeId { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[MaxLength(30)]
|
|
public string Symbol { get; set; } = string.Empty;
|
|
|
|
[MaxLength(30)]
|
|
public string Isin { get; set; } = string.Empty;
|
|
|
|
[MaxLength(200)]
|
|
public string CompanyName { get; set; } = string.Empty;
|
|
|
|
public Guid? AlpacaOrderId { get; set; }
|
|
|
|
[MaxLength(20)]
|
|
public string Side { get; set; } = "BUY"; // "BUY", "SELL"
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal Quantity { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal SignalEntryPrice { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal? ActualFillPrice { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal StopLossPrice { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal TakeProfitPrice1 { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal? TakeProfitPrice2 { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal CalculatedCrv { get; set; }
|
|
|
|
public double WinRate { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal? SlippagePercent { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal RealizedPnl { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,4)")]
|
|
public decimal? RealizedPnlPercent { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(30)]
|
|
public string Status { get; set; } = "Proposed"; // "Proposed", "Submitted", "Accepted", "PartiallyFilled", "Filled", "Closed", "Rejected", "Canceled"
|
|
|
|
[MaxLength(1000)]
|
|
public string? RejectReason { get; set; }
|
|
|
|
public DateTime PlacedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
public DateTime? FilledAt { get; set; }
|
|
|
|
public DateTime? ClosedAt { get; set; }
|
|
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|