Fix solution build
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
using Managing.Domain.Bots;
|
||||
using Managing.Domain.Workflows;
|
||||
|
||||
namespace Managing.Application.Abstractions
|
||||
{
|
||||
public interface IBotFactory
|
||||
{
|
||||
IBot CreateSimpleBot(string botName, Workflow workflow);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a trading bot using the unified TradingBot class
|
||||
/// </summary>
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace Managing.Application.Abstractions
|
||||
|
||||
Task<bool> UpdateScenario(string name, List<string> strategies, int? loopbackPeriod);
|
||||
|
||||
Task<bool> UpdateStrategy(IndicatorType indicatorType, string name, int? period, int? fastPeriods, int? slowPeriods,
|
||||
Task<bool> UpdateStrategy(IndicatorType indicatorType, string name, int? period, int? fastPeriods,
|
||||
int? slowPeriods,
|
||||
int? signalPeriods, double? multiplier, int? stochPeriods, int? smoothPeriods, int? cyclePeriods);
|
||||
|
||||
Task<IEnumerable<Scenario>> GetScenariosByUserAsync(User user);
|
||||
@@ -49,9 +50,11 @@ namespace Managing.Application.Abstractions
|
||||
Task<bool> DeleteScenariosByUser(User user);
|
||||
Task<bool> UpdateScenarioByUser(User user, string name, List<string> strategies, int? loopbackPeriod);
|
||||
|
||||
Task<bool> UpdateIndicatorByUser(User user, IndicatorType indicatorType, string name, int? period, int? fastPeriods,
|
||||
Task<bool> UpdateIndicatorByUser(User user, IndicatorType indicatorType, string name, int? period,
|
||||
int? fastPeriods,
|
||||
int? slowPeriods, int? signalPeriods, double? multiplier, int? stochPeriods, int? smoothPeriods,
|
||||
int? cyclePeriods);
|
||||
|
||||
Task<Scenario> GetScenarioByNameAndUserAsync(string scenarioName, User user);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ using Managing.Domain.Bots;
|
||||
using Managing.Domain.Candles;
|
||||
using Managing.Domain.Scenarios;
|
||||
using Managing.Domain.Users;
|
||||
using Managing.Domain.Workflows;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using static Managing.Common.Enums;
|
||||
@@ -54,19 +53,6 @@ namespace Managing.Application.Backtesting
|
||||
_grainFactory = grainFactory;
|
||||
}
|
||||
|
||||
public Backtest RunSimpleBotBacktest(Workflow workflow, bool save = false)
|
||||
{
|
||||
var simplebot = _botFactory.CreateSimpleBot("scenario", workflow);
|
||||
Backtest result = null;
|
||||
if (save && result != null)
|
||||
{
|
||||
// Simple bot backtest not implemented yet, would need user
|
||||
// _backtestRepository.InsertBacktestForUser(null, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs a trading bot backtest with the specified configuration and date range.
|
||||
/// Automatically handles different bot types based on config.BotType.
|
||||
@@ -80,7 +66,7 @@ namespace Managing.Application.Backtesting
|
||||
/// <param name="requestId">The request ID to associate with this backtest (optional)</param>
|
||||
/// <param name="metadata">Additional metadata to associate with this backtest (optional)</param>
|
||||
/// <returns>The lightweight backtest results</returns>
|
||||
public async Task<LightBacktest> RunTradingBotBacktest(
|
||||
public async Task<LightBacktestResponse> RunTradingBotBacktest(
|
||||
TradingBotConfig config,
|
||||
DateTime startDate,
|
||||
DateTime endDate,
|
||||
@@ -156,7 +142,7 @@ namespace Managing.Application.Backtesting
|
||||
/// <param name="requestId">The request ID to associate with this backtest (optional)</param>
|
||||
/// <param name="metadata">Additional metadata to associate with this backtest (optional)</param>
|
||||
/// <returns>The lightweight backtest results</returns>
|
||||
public async Task<LightBacktest> RunTradingBotBacktest(
|
||||
public async Task<LightBacktestResponse> RunTradingBotBacktest(
|
||||
TradingBotConfig config,
|
||||
List<Candle> candles,
|
||||
User user = null,
|
||||
@@ -170,7 +156,7 @@ namespace Managing.Application.Backtesting
|
||||
/// <summary>
|
||||
/// Core backtesting logic - handles the actual backtest execution with pre-loaded candles
|
||||
/// </summary>
|
||||
private async Task<LightBacktest> RunBacktestWithCandles(
|
||||
private async Task<LightBacktestResponse> RunBacktestWithCandles(
|
||||
TradingBotConfig config,
|
||||
List<Candle> candles,
|
||||
User user = null,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Managing.Application.Abstractions.Services;
|
||||
using Managing.Application.ManageBot;
|
||||
using Managing.Domain.Bots;
|
||||
using Managing.Domain.Workflows;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Managing.Application.Bots.Base
|
||||
@@ -35,11 +34,6 @@ namespace Managing.Application.Bots.Base
|
||||
_backupBotService = backupBotService;
|
||||
}
|
||||
|
||||
IBot IBotFactory.CreateSimpleBot(string botName, Workflow workflow)
|
||||
{
|
||||
return new SimpleBot(botName, _tradingBotLogger, workflow, _botService, _backupBotService);
|
||||
}
|
||||
|
||||
public async Task<ITradingBot> CreateTradingBot(TradingBotConfig config)
|
||||
{
|
||||
// Delegate to BotService which handles scenario loading properly
|
||||
|
||||
@@ -146,7 +146,8 @@ namespace Managing.Application.Scenarios
|
||||
return scenarios.Where(s => s.User?.Name == user.Name);
|
||||
}
|
||||
|
||||
public async Task<Scenario> CreateScenarioForUser(User user, string name, List<string> strategies, int? loopbackPeriod = 1)
|
||||
public async Task<Scenario> CreateScenarioForUser(User user, string name, List<string> strategies,
|
||||
int? loopbackPeriod = 1)
|
||||
{
|
||||
var scenario = new Scenario(name, loopbackPeriod ?? 1)
|
||||
{
|
||||
@@ -193,6 +194,7 @@ namespace Managing.Application.Scenarios
|
||||
{
|
||||
await _tradingService.DeleteScenarioAsync(scenario.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -211,6 +213,7 @@ namespace Managing.Application.Scenarios
|
||||
{
|
||||
await _tradingService.DeleteScenarioAsync(scenario.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -226,7 +229,8 @@ namespace Managing.Application.Scenarios
|
||||
return scenario != null && scenario.User?.Name == user.Name ? scenario : null;
|
||||
}
|
||||
|
||||
public async Task<Indicator> CreateIndicatorForUser(User user, IndicatorType type, string name, int? period = null,
|
||||
public async Task<Indicator> CreateIndicatorForUser(User user, IndicatorType type, string name,
|
||||
int? period = null,
|
||||
int? fastPeriods = null, int? slowPeriods = null, int? signalPeriods = null,
|
||||
double? multiplier = null, int? stochPeriods = null, int? smoothPeriods = null,
|
||||
int? cyclePeriods = null)
|
||||
@@ -253,6 +257,7 @@ namespace Managing.Application.Scenarios
|
||||
{
|
||||
await _tradingService.DeleteStrategyAsync(strategy.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -262,7 +267,8 @@ namespace Managing.Application.Scenarios
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateScenarioByUser(User user, string name, List<string> strategies, int? loopbackPeriod)
|
||||
public async Task<bool> UpdateScenarioByUser(User user, string name, List<string> strategies,
|
||||
int? loopbackPeriod)
|
||||
{
|
||||
var scenario = await _tradingService.GetScenarioByNameAsync(name);
|
||||
if (scenario == null || scenario.User?.Name != user.Name)
|
||||
|
||||
Reference in New Issue
Block a user