Update account/position and platform summary
This commit is contained in:
@@ -305,7 +305,8 @@ namespace Managing.Infrastructure.Messengers.Discord
|
||||
|
||||
await component.RespondAsync("Alright, let met few seconds to close this position");
|
||||
var position = await tradingService.GetPositionByIdentifierAsync(Guid.Parse(parameters[1]));
|
||||
var command = new ClosePositionCommand(position);
|
||||
|
||||
var command = new ClosePositionCommand(position, position.AccountId);
|
||||
var result =
|
||||
await new ClosePositionCommandHandler(exchangeService, accountService, tradingService, scopeFactory)
|
||||
.Handle(command);
|
||||
@@ -336,7 +337,7 @@ namespace Managing.Infrastructure.Messengers.Discord
|
||||
IsInline = true
|
||||
},
|
||||
};
|
||||
var embed = DiscordHelpers.GetEmbed(position.AccountName, $"Position status is now {result.Status}", fields,
|
||||
var embed = DiscordHelpers.GetEmbed($"Position {position.Identifier}", $"Position status is now {result.Status}", fields,
|
||||
position.ProfitAndLoss.Net > 0 ? Color.Green : Color.Red);
|
||||
await component.Channel.SendMessageAsync("", embed: embed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user