56 lines
2.3 KiB
C#
56 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace FinlyticCore.Dtos.TechnicalAnalysis;
|
|
|
|
/// <summary>
|
|
/// Individual take-profit tier in a staged scale-out exit plan.
|
|
/// </summary>
|
|
public record TakeProfitStage(
|
|
[property: JsonPropertyName("stageNumber")] int StageNumber,
|
|
[property: JsonPropertyName("targetPrice")] decimal TargetPrice,
|
|
[property: JsonPropertyName("percentToClose")] decimal PercentToClose,
|
|
[property: JsonPropertyName("rMultiple")] decimal RMultiple,
|
|
[property: JsonPropertyName("description")] string Description
|
|
);
|
|
|
|
/// <summary>
|
|
/// Break-even trigger rule for locking in free-rolls.
|
|
/// </summary>
|
|
public record BreakEvenRule(
|
|
[property: JsonPropertyName("enabled")] bool Enabled,
|
|
[property: JsonPropertyName("triggerPrice")] decimal TriggerPrice,
|
|
[property: JsonPropertyName("offsetToCoverFees")] decimal OffsetToCoverFees
|
|
);
|
|
|
|
/// <summary>
|
|
/// Trailing stop management rule for trend following.
|
|
/// </summary>
|
|
public record TrailingStopRule(
|
|
[property: JsonPropertyName("type")] TrailingStopType Type,
|
|
[property: JsonPropertyName("multiplier")] decimal Multiplier,
|
|
[property: JsonPropertyName("activationPrice")] decimal ActivationPrice,
|
|
[property: JsonPropertyName("indicatorKey")] string IndicatorKey
|
|
);
|
|
|
|
/// <summary>
|
|
/// Indicator or structural reversal condition that triggers an early trade exit.
|
|
/// </summary>
|
|
public record ReversalCondition(
|
|
[property: JsonPropertyName("ruleDescription")] string RuleDescription,
|
|
[property: JsonPropertyName("indicatorTrigger")] string IndicatorTrigger
|
|
);
|
|
|
|
/// <summary>
|
|
/// Composable, complete exit plan decoupling entry strategy logic from execution management.
|
|
/// </summary>
|
|
public record ExitPlan(
|
|
[property: JsonPropertyName("strategyType")] ExitStrategyType StrategyType,
|
|
[property: JsonPropertyName("initialStopLoss")] decimal InitialStopLoss,
|
|
[property: JsonPropertyName("takeProfitStages")] List<TakeProfitStage> TakeProfitStages,
|
|
[property: JsonPropertyName("breakEvenRule")] BreakEvenRule? BreakEvenRule = null,
|
|
[property: JsonPropertyName("trailingStopRule")] TrailingStopRule? TrailingStopRule = null,
|
|
[property: JsonPropertyName("reversalCondition")] ReversalCondition? ReversalCondition = null,
|
|
[property: JsonPropertyName("maxHoldingBars")] int? MaxHoldingBars = null
|
|
);
|