实现策略引擎核心功能,包括三种策略计算器和相关DTO定义: 1. 添加双均线策略(ma_trend)计算器 2. 添加吊灯止损策略(chandelier_exit)计算器 3. 添加风险平价策略(risk_parity)计算器 4. 定义策略类型常量类和策略配置DTO 5. 实现策略引擎服务接口和扩展方法 6. 更新项目引用和README文档
38 lines
860 B
C#
38 lines
860 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; }
|
|
} |