Files
Finlytic/FinlyticSimulation/Settings/SimulationSettingKeys.cs
T

54 lines
3.7 KiB
C#

using FinlyticCore.Models.Settings;
namespace FinlyticSimulation.Settings;
public static class SimulationSettingKeys
{
// --- Logging Channels ---
public static readonly SettingKey<bool> HealthPingChannel = new("Logging.Channel.Health", true);
public static readonly SettingKey<bool> MqttChannel = new("Logging.Channel.MQTT", true);
public static readonly SettingKey<bool> SimulationChannel = new("Logging.Channel.Simulation", true);
public static readonly SettingKey<bool> MatrixChannel = new("Logging.Channel.Matrix", true);
// --- Simulation & Fee Defaults ---
public static readonly SettingKey<decimal> DefaultSlippagePercent = new("Simulation.DefaultSlippagePercent", 0.05m); // 0.05%
public static readonly SettingKey<decimal> DefaultOrderFeeEur = new("Simulation.DefaultOrderFeeEur", 1.00m); // 1.00 € pro Order
public static readonly SettingKey<decimal> DefaultStartingCapital = new("Simulation.DefaultStartingCapital", 10000m);
public static readonly SettingKey<int> MinSampleTradesForApproval = new("Simulation.MinSampleTradesForApproval", 5);
public static readonly SettingKey<decimal> HighProfitFactorThreshold = new("Simulation.HighProfitFactorThreshold", 1.60m);
public static readonly SettingKey<decimal> LowProfitFactorThreshold = new("Simulation.LowProfitFactorThreshold", 1.00m);
/// <summary>
/// Simulated knock-out derivative barrier distance below (long) / above (short) the strategy's stop-loss,
/// as a percent. Was previously a hardcoded 2% (0.98/1.02 multiplier) in <c>VirtualBacktestBroker</c>.
/// </summary>
public static readonly SettingKey<decimal> KnockOutBarrierBufferPercent = new("Simulation.KnockOutBarrierBufferPercent", 2.0m);
/// <summary>
/// Fallback trailing-stop distance (as a percent of the current close) used once a position's TP1 has
/// been hit, for any <c>TrailingStopRule.Type</c> other than <see cref="FinlyticCore.Dtos.TechnicalAnalysis.TrailingStopType.AtrMultiplier"/>
/// (which is instead simulated honestly via that rule's own ATR multiplier - see <c>VirtualBacktestBroker.UpdateActivePositions</c>).
/// <c>SuperTrendLine</c>/<c>SwingPoints</c> rules would require recomputing that live indicator on every
/// backtest bar, which this broker does not have the inputs for; this flat, configurable percent is an
/// explicit, documented approximation for those two rule types rather than silently reusing the ATR
/// multiplier's numeric value for an unrelated rule type (the previous hardcoded behavior).
/// </summary>
public static readonly SettingKey<decimal> DefaultTrailingStopPercent = new("Simulation.DefaultTrailingStopPercent", 3.0m);
/// <summary>
/// Whether <c>ReliabilityMatrixRecomputeBackgroundService</c> periodically re-runs backtests for every
/// (Isin, StrategyKey, Timeframe) combination already present in the reliability matrix, instead of that
/// data only ever being refreshed when a human happens to manually re-run the same backtest.
/// </summary>
public static readonly SettingKey<bool> EnableScheduledMatrixRecompute = new("Simulation.EnableScheduledMatrixRecompute", true);
/// <summary>
/// How old a reliability-matrix row (<c>SimulationStrategyMatrixEntity.UpdatedAtUtc</c>) must be before
/// <c>ReliabilityMatrixRecomputeBackgroundService</c> refreshes it again.
/// </summary>
public static readonly SettingKey<int> MatrixRecomputeIntervalHours = new("Simulation.MatrixRecomputeIntervalHours", 24);
/// <summary>How often <c>ReliabilityMatrixRecomputeBackgroundService</c> checks for stale matrix rows.</summary>
public static readonly SettingKey<int> MatrixRecomputeCheckIntervalMinutes = new("Simulation.MatrixRecomputeCheckIntervalMinutes", 60);
}