Add genetic backtest to worker

This commit is contained in:
2025-11-09 03:32:08 +07:00
parent 7dba29c66f
commit 7e08e63dd1
30 changed files with 5056 additions and 232 deletions

View File

@@ -400,7 +400,7 @@ public static class ApiBootstrap
// Processors
services.AddTransient<IBacktester, Backtester>();
services.AddTransient<BacktestJobService>();
services.AddTransient<JobService>();
services.AddTransient<IExchangeProcessor, EvmProcessor>();
services.AddTransient<ITradaoService, TradaoService>();
@@ -443,7 +443,7 @@ public static class ApiBootstrap
services.AddTransient<IAccountRepository, PostgreSqlAccountRepository>();
services.AddTransient<IBacktestRepository, PostgreSqlBacktestRepository>();
services.AddTransient<IBacktestJobRepository, PostgreSqlJobRepository>();
services.AddTransient<IJobRepository, PostgreSqlJobRepository>();
services.AddTransient<IGeneticRepository, PostgreSqlGeneticRepository>();
services.AddTransient<ITradingRepository, PostgreSqlTradingRepository>();
services.AddTransient<ISettingsRepository, PostgreSqlSettingsRepository>();

View File

@@ -1,3 +1,4 @@
using Managing.Application;
using Managing.Application.Abstractions;
using Managing.Application.Abstractions.Repositories;
using Managing.Application.Abstractions.Services;
@@ -57,7 +58,6 @@ public static class ComputeBootstrap
// Services not needed for compute worker (depend on IBacktester/Orleans)
// services.AddScoped<IStatisticService, StatisticService>(); // Requires IBacktester
// services.AddScoped<ISettingsService, SettingsService>(); // Requires IBacktester
// services.AddScoped<IGeneticService, GeneticService>(); // Requires IBacktester
// services.AddScoped<IAgentService, AgentService>(); // May require Orleans
// services.AddScoped<IBotService, BotService>(); // May require Orleans
// services.AddScoped<IWorkerService, WorkerService>(); // May require Orleans
@@ -66,6 +66,13 @@ public static class ComputeBootstrap
// Processors
// Note: IBacktester not needed for compute worker - BacktestExecutor is used directly
services.AddTransient<BacktestExecutor>();
services.AddTransient<GeneticExecutor>();
// Adapter to make BacktestExecutor implement IBacktester (needed for GeneticService)
services.AddTransient<IBacktester, BacktestExecutorAdapter>();
// Genetic service (needed for GeneticExecutor)
services.AddScoped<IGeneticService, GeneticService>();
services.AddTransient<IExchangeProcessor, EvmProcessor>();
services.AddTransient<ITradaoService, TradaoService>();
@@ -120,7 +127,7 @@ public static class ComputeBootstrap
// PostgreSql Repositories
services.AddTransient<IAccountRepository, PostgreSqlAccountRepository>();
services.AddTransient<IBacktestRepository, PostgreSqlBacktestRepository>();
services.AddTransient<IBacktestJobRepository, PostgreSqlJobRepository>();
services.AddTransient<IJobRepository, PostgreSqlJobRepository>();
services.AddTransient<IGeneticRepository, PostgreSqlGeneticRepository>();
services.AddTransient<ITradingRepository, PostgreSqlTradingRepository>();
services.AddTransient<ISettingsRepository, PostgreSqlSettingsRepository>();