- GetNavHistoryAsync现在会自动检查是否有历史数据 - 无历史数据时自动调用BackfillNavHistoryInternalAsync - 拆分内部回填方法,避免重复验证权限
26 lines
799 B
C#
Executable File
26 lines
799 B
C#
Executable File
using AssetManager.Infrastructure.StrategyEngine.Calculators;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace AssetManager.Infrastructure.StrategyEngine;
|
|
|
|
/// <summary>
|
|
/// 策略引擎服务注册扩展
|
|
/// </summary>
|
|
public static class StrategyEngineExtensions
|
|
{
|
|
/// <summary>
|
|
/// 注册策略引擎及所有计算器
|
|
/// </summary>
|
|
public static IServiceCollection AddStrategyEngine(this IServiceCollection services)
|
|
{
|
|
// 注册策略计算器
|
|
services.AddScoped<IStrategyCalculator, MaTrendCalculator>();
|
|
services.AddScoped<IStrategyCalculator, ChandelierExitCalculator>();
|
|
services.AddScoped<IStrategyCalculator, RiskParityCalculator>();
|
|
|
|
// 注册策略引擎
|
|
services.AddScoped<IStrategyEngine, StrategyEngine>();
|
|
|
|
return services;
|
|
}
|
|
} |