Update bot config on front and back

This commit is contained in:
2025-06-04 15:42:21 +07:00
parent f41af96406
commit 756cd5fb11
14 changed files with 422 additions and 369 deletions

View File

@@ -1,79 +1,40 @@
using Managing.Domain.Accounts;
using Managing.Domain.Backtests;
using Managing.Domain.Backtests;
using Managing.Domain.Bots;
using Managing.Domain.Candles;
using Managing.Domain.MoneyManagements;
using Managing.Domain.Scenarios;
using Managing.Domain.Users;
using static Managing.Common.Enums;
namespace Managing.Application.Abstractions.Services
{
public interface IBacktester
{
Task<Backtest> RunScalpingBotBacktest(
Account account,
MoneyManagement moneyManagement,
Ticker ticker,
Scenario scenario,
Timeframe timeframe,
decimal balance,
TradingBotConfig config,
DateTime startDate,
DateTime endDate,
User user = null,
bool isForWatchingOnly = false,
bool save = false,
List<Candle>? initialCandles = null,
int cooldownPeriod = 1,
int maxLossStreak = 0,
decimal? maxPositionTimeHours = null,
bool flipOnlyWhenInProfit = true);
List<Candle>? initialCandles = null);
Task<Backtest> RunFlippingBotBacktest(
Account account,
MoneyManagement moneyManagement,
Ticker ticker,
Scenario scenario,
Timeframe timeframe,
decimal balance,
TradingBotConfig config,
DateTime startDate,
DateTime endDate,
User user = null,
bool isForWatchingOnly = false,
bool save = false,
List<Candle>? initialCandles = null,
int cooldownPeriod = 1,
int maxLossStreak = 0,
decimal? maxPositionTimeHours = null,
bool flipOnlyWhenInProfit = true);
List<Candle>? initialCandles = null);
bool DeleteBacktest(string id);
bool DeleteBacktests();
Task<Backtest> RunScalpingBotBacktest(
Account account,
MoneyManagement moneyManagement,
Scenario scenario,
Timeframe timeframe,
TradingBotConfig config,
List<Candle> candles,
decimal balance,
User user = null,
int cooldownPeriod = 1,
int maxLossStreak = 0,
decimal? maxPositionTimeHours = null,
bool flipOnlyWhenInProfit = true);
User user = null);
Task<Backtest> RunFlippingBotBacktest(
Account account,
MoneyManagement moneyManagement,
Scenario scenario,
Timeframe timeframe,
TradingBotConfig config,
List<Candle> candles,
decimal balance,
User user = null,
int cooldownPeriod = 1,
int maxLossStreak = 0,
decimal? maxPositionTimeHours = null,
bool flipOnlyWhenInProfit = true);
User user = null);
// User-specific operations
Task<IEnumerable<Backtest>> GetBacktestsByUser(User user);