using Managing.Domain.Backtests;
using Managing.Domain.Bots;
using Managing.Domain.Candles;
using Managing.Domain.Users;
using Orleans;
namespace Managing.Application.Abstractions.Grains;
///
/// Orleans grain interface for Backtest TradingBot operations.
/// This interface extends ITradingBotGrain with backtest-specific functionality.
///
public interface IBacktestTradingBotGrain : IGrainWithGuidKey
{
///
/// Runs a complete backtest following the exact pattern of GetBacktestingResult from Backtester.cs
///
/// The trading bot configuration for this backtest
/// The candles to use for backtesting
/// The user running the backtest (optional, required for saving)
/// Whether to save the backtest results
/// Whether to include candles and indicators values in the response
/// The request ID to associate with this backtest
/// Additional metadata to associate with this backtest
/// The complete backtest result
Task RunBacktestAsync(TradingBotConfig config, List candles, User user = null, bool save = false, bool withCandles = false, string requestId = null, object metadata = null);
///
/// Gets the current backtest progress
///
/// Backtest progress information
Task GetBacktestProgressAsync();
}
///
/// Represents the progress of a backtest
///
public class BacktestProgress
{
public bool IsInitialized { get; set; }
public int TotalCandles { get; set; }
public int ProcessedCandles { get; set; }
public double ProgressPercentage { get; set; }
public bool IsComplete { get; set; }
}