using Managing.Domain.Backtests;
using Managing.Domain.Bots;
using Managing.Domain.Candles;
using Managing.Domain.Users;
namespace Managing.Application.Abstractions.Services
{
public interface IBacktester
{
///
/// Runs a trading bot backtest with the specified configuration and date range.
/// Automatically handles different bot types based on config.BotType.
///
/// The trading bot configuration (must include Scenario object or ScenarioName)
/// The start date for the backtest
/// The end date for the backtest
/// The user running the backtest (optional)
/// Whether to save the backtest results
/// Whether to include candles and indicators values in the response
/// The request ID to associate with this backtest (optional)
/// Additional metadata to associate with this backtest (optional)
/// The backtest results
Task RunTradingBotBacktest(
TradingBotConfig config,
DateTime startDate,
DateTime endDate,
User user = null,
bool save = false,
bool withCandles = false,
string requestId = null,
object metadata = null);
///
/// Runs a trading bot backtest with pre-loaded candles.
/// Automatically handles different bot types based on config.BotType.
///
/// The trading bot configuration (must include Scenario object or ScenarioName)
/// The candles to use for backtesting
/// The user running the backtest (optional)
/// Whether to include candles and indicators values in the response
/// The request ID to associate with this backtest (optional)
/// Additional metadata to associate with this backtest (optional)
/// The backtest results
Task RunTradingBotBacktest(
TradingBotConfig config,
List candles,
User user = null,
bool withCandles = false,
string requestId = null,
object metadata = null);
// Additional methods for backtest management
bool DeleteBacktest(string id);
bool DeleteBacktests();
IEnumerable GetBacktestsByUser(User user);
IEnumerable GetBacktestsByRequestId(string requestId);
(IEnumerable Backtests, int TotalCount) GetBacktestsByRequestIdPaginated(string requestId, int page, int pageSize, string sortBy = "score", string sortOrder = "desc");
Backtest GetBacktestByIdForUser(User user, string id);
bool DeleteBacktestByUser(User user, string id);
bool DeleteBacktestsByIdsForUser(User user, IEnumerable ids);
bool DeleteBacktestsByUser(User user);
(IEnumerable Backtests, int TotalCount) GetBacktestsByUserPaginated(User user, int page, int pageSize, string sortBy = "score", string sortOrder = "desc");
}
}