Update bot workflow

This commit is contained in:
2025-03-02 18:24:50 +01:00
parent 3e44b2d14e
commit e59898bccb
13 changed files with 198 additions and 112 deletions

View File

@@ -111,8 +111,10 @@ public class TradingBot : Bot, ITradingBot
try
{
await MessengerService.SendMessage(
$"Hi everyone, I'm going to run {Name}. \nI will send a message here everytime a signal is triggered by the {string.Join(",", Strategies.Select(s => s.Name))} strategies.");
// await MessengerService.SendMessage(
// $"Hey everyone! I'm about to start {Name}. 🚀\n" +
// $"I'll post an update here each time a signal is triggered by the following strategies: {string.Join(", ", Strategies.Select(s => s.Name))}."
// );
}
catch (Exception ex)
{
@@ -185,7 +187,7 @@ public class TradingBot : Bot, ITradingBot
if (!IsForWatchingOnly)
await ManagePositions();
if (!IsForBacktest)
{
SaveBackup();
@@ -414,11 +416,11 @@ public class TradingBot : Bot, ITradingBot
await LogWarning($"Open position trade is rejected for signal {signal.Identifier}");
// if position is not open
// Re-open the trade for the signal only if signal still up
//if (signal.Status == SignalStatus.PositionOpen)
//{
// Logger.LogInformation($"Try to re-open position");
// OpenPosition(signal);
//}
if (signal.Status == SignalStatus.PositionOpen)
{
Logger.LogInformation($"Try to re-open position");
await OpenPosition(signal);
}
}
}
catch (Exception ex)
@@ -495,7 +497,7 @@ public class TradingBot : Bot, ITradingBot
MoneyManagement,
signal.Direction,
Ticker,
PositionInitiator.Bot,
IsForBacktest ? PositionInitiator.PaperTrading : PositionInitiator.Bot ,
signal.Date,
IsForBacktest,
lastPrice,