diff --git a/src/Managing.Application/Bots/TradingBotBase.cs b/src/Managing.Application/Bots/TradingBotBase.cs index 0b1ff44f..9e4a6397 100644 --- a/src/Managing.Application/Bots/TradingBotBase.cs +++ b/src/Managing.Application/Bots/TradingBotBase.cs @@ -402,7 +402,8 @@ public class TradingBotBase : ITradingBot if (!Config.IsForBacktest) { - var brokerPosition = brokerPositions.FirstOrDefault(p => p.Ticker == Config.Ticker); + var brokerPosition = brokerPositions.FirstOrDefault(p => + p.Ticker == Config.Ticker && p.OriginDirection == positionForSignal.OriginDirection); if (brokerPosition != null) { var previousPositionStatus = internalPosition.Status; @@ -1164,7 +1165,7 @@ public class TradingBotBase : ITradingBot } await LogInformation( - $"šŸ”§ Closing Trade\nTicker: `{Config.Ticker}`\nPrice: `${lastPrice}`\nšŸ“‹ Type: `{tradeToClose.TradeType}`\nšŸ“Š Quantity: `{tradeToClose.Quantity:F5}`"); + $"šŸ”§ Closing {position.OriginDirection} Trade\nTicker: `{Config.Ticker}`\nPrice: `${lastPrice}`\nšŸ“‹ Type: `{tradeToClose.TradeType}`\nšŸ“Š Quantity: `{tradeToClose.Quantity:F5}`"); decimal quantity = 0; diff --git a/src/Managing.Application/Users/UserService.cs b/src/Managing.Application/Users/UserService.cs index 4230ad7e..ce14fade 100644 --- a/src/Managing.Application/Users/UserService.cs +++ b/src/Managing.Application/Users/UserService.cs @@ -56,9 +56,10 @@ public class UserService : IUserService if (!_authorizedAddresses.Any(a => string.Equals(a, recoveredAddress, StringComparison.OrdinalIgnoreCase))) { - throw new Exception($"Address {recoveredAddress} not authorized"); + throw new Exception($"Address {recoveredAddress} not authorized. Please wait for team approval."); } + if (recoveredAddress == null || !recoveredAddress.Equals(address)) { throw new Exception($"Address {recoveredAddress} not corresponding");