Update the position count and initiator

This commit is contained in:
2025-08-15 08:47:48 +07:00
parent 7528405845
commit b4a4656b3b
21 changed files with 1617 additions and 42 deletions

View File

@@ -713,7 +713,8 @@ public class TradingBotBase : ITradingBot
Config.BotTradingBalance,
Config.IsForBacktest,
lastPrice,
signalIdentifier: signal.Identifier);
signalIdentifier: signal.Identifier,
initiatorIdentifier: Identifier);
var position = await ServiceScopeHelpers
.WithScopedServices<IExchangeService, IAccountService, ITradingService, Position>(
@@ -978,7 +979,7 @@ public class TradingBotBase : ITradingBot
_scopeFactory, async (exchangeService, accountService, tradingService) =>
{
closedPosition =
await new ClosePositionCommandHandler(exchangeService, accountService, tradingService)
await new ClosePositionCommandHandler(exchangeService, accountService, tradingService, _scopeFactory)
.Handle(command);
});