AssetManager.API/AssetManager.Models/DTOs/RiskParityConfig.cs
niannian zheng b5499ef7fe refactor: 将模型属性改为可为空类型以增强健壮性
- 修改ApiResponse、RiskParityConfig等DTO类的属性为可空类型
- 在策略计算器中添加空值检查逻辑
- 更新服务层代码处理可能的空值情况
- 添加发布配置文件FolderProfile.pubxml
2026-03-06 15:51:59 +08:00

38 lines
862 B
C#

namespace AssetManager.Models.DTOs;
/// <summary>
/// 风险平价策略配置
/// </summary>
public class RiskParityConfig
{
/// <summary>
/// 历史数据回看周期
/// </summary>
public int LookbackPeriod { get; set; } = 60;
/// <summary>
/// 再平衡阈值(偏离度超过 5% 触发再平衡)
/// </summary>
public decimal RebalanceThreshold { get; set; } = 0.05m;
/// <summary>
/// 目标资产列表(可选,不指定则使用当前持仓)
/// </summary>
public List<AssetAllocation>? Assets { get; set; }
}
/// <summary>
/// 资产配置项
/// </summary>
public class AssetAllocation
{
/// <summary>
/// 标的代码
/// </summary>
public string? Symbol { get; set; }
/// <summary>
/// 目标权重
/// </summary>
public decimal TargetWeight { get; set; }
}