This commit is contained in:
2025-06-05 01:17:15 +07:00
parent 973a8c7c61
commit 6441687df3
12 changed files with 281 additions and 198 deletions

View File

@@ -37,10 +37,37 @@ namespace Managing.Application.Bots.Base
return new SimpleBot(botName, _tradingBotLogger, workflow, _botService);
}
ITradingBot IBotFactory.CreateTradingBot(TradingBotConfig config)
{
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,
_accountService,
_messengerService,
_botService,
config);
}
ITradingBot IBotFactory.CreateBacktestTradingBot(TradingBotConfig config)
{
config.IsForBacktest = true;
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,
_accountService,
_messengerService,
_botService,
config);
}
// Legacy methods for backward compatibility - will be deprecated
ITradingBot IBotFactory.CreateScalpingBot(TradingBotConfig config)
{
config.BotType = BotType.ScalpingBot;
return new ScalpingBot(
config.FlipPosition = false;
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,
@@ -54,7 +81,8 @@ namespace Managing.Application.Bots.Base
{
config.BotType = BotType.ScalpingBot;
config.IsForBacktest = true;
return new ScalpingBot(
config.FlipPosition = false;
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,
@@ -67,7 +95,8 @@ namespace Managing.Application.Bots.Base
public ITradingBot CreateFlippingBot(TradingBotConfig config)
{
config.BotType = BotType.FlippingBot;
return new FlippingBot(
config.FlipPosition = true;
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,
@@ -81,7 +110,8 @@ namespace Managing.Application.Bots.Base
{
config.BotType = BotType.FlippingBot;
config.IsForBacktest = true;
return new FlippingBot(
config.FlipPosition = true;
return new TradingBot(
_exchangeService,
_tradingBotLogger,
_tradingService,