Update bot workflow
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user