Fixes for bots running (#22)
* Fixes for bots running * Up botmanager * Add cooldown * Refact can open position * Add cooldown Period and MaxLossStreak * Add agentName * Add env variable for botManager * Always enable Botmanager * Fix bot handle * Fix get positions * Add Ticker url * Dont start stopped bot * fix
This commit is contained in:
@@ -19,15 +19,14 @@ namespace Managing.Application.ManageBot
|
||||
public Task<ITradingBot> Handle(GetUserStrategyCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var allActiveBots = _botService.GetActiveBots();
|
||||
|
||||
|
||||
// Find the specific strategy that matches both user and strategy name
|
||||
var strategy = allActiveBots
|
||||
.FirstOrDefault(bot =>
|
||||
bot.User != null &&
|
||||
bot.User.Name == request.AgentName &&
|
||||
bot.Name == request.StrategyName);
|
||||
.FirstOrDefault(bot =>
|
||||
bot.User.AgentName == request.AgentName &&
|
||||
bot.Identifier == request.StrategyName);
|
||||
|
||||
return Task.FromResult(strategy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user