147 lines
4.4 KiB
C#
147 lines
4.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
using FinlyticCore.Models.Analyzer;
|
|
|
|
namespace FinlyticCore.Models.Trades;
|
|
|
|
/// <summary>
|
|
/// Trade proposal generated by FinlyticAnalyzer and dispatched via MQTT QoS 2.
|
|
/// </summary>
|
|
public class TradeProposalDto
|
|
{
|
|
[JsonPropertyName("tradeId")]
|
|
public string TradeId { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("userId")]
|
|
public string? UserId { get; set; }
|
|
|
|
[JsonPropertyName("isGlobalProposal")]
|
|
public bool IsGlobalProposal { get; set; } = true;
|
|
|
|
[JsonPropertyName("status")]
|
|
public string Status { get; set; } = "Proposed";
|
|
|
|
[JsonPropertyName("analysisId")]
|
|
public string AnalysisId { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("eventId")]
|
|
public string EventId { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("sector")]
|
|
public string Sector { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("symbol")]
|
|
public string Symbol { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("isin")]
|
|
public string Isin { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("companyName")]
|
|
public string CompanyName { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("entryPrice")]
|
|
public decimal EntryPrice { get; set; }
|
|
|
|
[JsonPropertyName("stopLoss")]
|
|
public decimal StopLoss { get; set; }
|
|
|
|
[JsonPropertyName("takeProfit")]
|
|
public decimal TakeProfit { get; set; }
|
|
|
|
[JsonPropertyName("signalType")]
|
|
public string SignalType { get; set; } = "BUY"; // "BUY", "SELL"
|
|
|
|
[JsonPropertyName("riskTolerance")]
|
|
public string RiskTolerance { get; set; } = "Moderate"; // "Conservative", "Moderate", "Aggressive"
|
|
|
|
[JsonPropertyName("timeframe")]
|
|
public string Timeframe { get; set; } = "1D"; // "1H", "4H", "1D", "1W"
|
|
|
|
[JsonPropertyName("instrumentType")]
|
|
public string InstrumentType { get; set; } = "Stock"; // "Stock", "Option", "CFD", "Crypto"
|
|
|
|
[JsonPropertyName("derivativeIsin")]
|
|
public string? DerivativeIsin { get; set; }
|
|
|
|
[JsonPropertyName("winRate")]
|
|
public double WinRate { get; set; }
|
|
|
|
[JsonPropertyName("vixRegime")]
|
|
public VixMarketRegime VixRegime { get; set; }
|
|
|
|
[JsonPropertyName("vixValue")]
|
|
public decimal VixValue { get; set; }
|
|
|
|
[JsonPropertyName("ttlMinutes")]
|
|
public int TtlMinutes { get; set; } = 60;
|
|
|
|
[JsonPropertyName("reasoning")]
|
|
public string Reasoning { get; set; } = string.Empty;
|
|
|
|
// --- New Fields for Detailed Execution & Rationale ---
|
|
[JsonPropertyName("entryZoneMin")]
|
|
public decimal? EntryZoneMin { get; set; }
|
|
|
|
[JsonPropertyName("entryZoneMax")]
|
|
public decimal? EntryZoneMax { get; set; }
|
|
|
|
[JsonPropertyName("takeProfitTargets")]
|
|
public List<decimal>? TakeProfitTargets { get; set; }
|
|
|
|
[JsonPropertyName("riskRewardRatio")]
|
|
public decimal? RiskRewardRatio { get; set; }
|
|
|
|
[JsonPropertyName("maxLeverage")]
|
|
public decimal? MaxLeverage { get; set; }
|
|
|
|
[JsonPropertyName("technicalRationale")]
|
|
public string TechnicalRationale { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("fundamentalRationale")]
|
|
public string FundamentalRationale { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("riskWarning")]
|
|
public string RiskWarning { get; set; } = string.Empty;
|
|
|
|
// --- Real Trade Execution Data ---
|
|
[JsonPropertyName("actualEntryPrice")]
|
|
public decimal? ActualEntryPrice { get; set; }
|
|
|
|
[JsonPropertyName("positionSize")]
|
|
public decimal? PositionSize { get; set; }
|
|
|
|
[JsonPropertyName("leverageUsed")]
|
|
public decimal? LeverageUsed { get; set; }
|
|
|
|
[JsonPropertyName("entryFee")]
|
|
public decimal? EntryFee { get; set; }
|
|
|
|
[JsonPropertyName("exitFee")]
|
|
public decimal? ExitFee { get; set; }
|
|
|
|
[JsonPropertyName("executionTimestamp")]
|
|
public DateTime? ExecutionTimestamp { get; set; }
|
|
|
|
[JsonPropertyName("quantity")]
|
|
public decimal? Quantity { get; set; }
|
|
|
|
[JsonPropertyName("knockoutThreshold")]
|
|
public decimal? KnockoutThreshold { get; set; }
|
|
|
|
[JsonPropertyName("isRecurring")]
|
|
public bool IsRecurring { get; set; } = false;
|
|
|
|
[JsonPropertyName("currentPrice")]
|
|
public decimal? CurrentPrice { get; set; }
|
|
|
|
[JsonPropertyName("pnlAbsolute")]
|
|
public decimal? PnlAbsolute { get; set; }
|
|
|
|
[JsonPropertyName("pnlPercent")]
|
|
public decimal? PnlPercent { get; set; }
|
|
|
|
[JsonPropertyName("createdAt")]
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|