Files
Finlytic/FinlyticTrades/Entities/TradeHourlyUpdateEntity.cs
T

43 lines
1.2 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace FinlyticTrades.Entities;
[Table("trade_hourly_updates")]
[Index(nameof(TradeId), nameof(Timestamp))]
public class TradeHourlyUpdateEntity
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public Guid TradeId { get; set; }
[ForeignKey(nameof(TradeId))]
public TradeEntity? Trade { get; set; }
[Required]
[MaxLength(30)]
public string Recommendation { get; set; } = "Hold"; // "Hold", "AdjustSL", "AdjustTP", "Close"
[Column(TypeName = "decimal(18,4)")]
public decimal CurrentPrice { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? SuggestedStopLoss { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? SuggestedTakeProfit { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal VixValue { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? FloatingPnlPercent { get; set; }
public string Reasoning { get; set; } = string.Empty;
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}