Add webhook
This commit is contained in:
@@ -1163,7 +1163,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
{
|
||||
if (!Config.IsForBacktest)
|
||||
{
|
||||
await MessengerService.SendTradeMessage(message, isBadBehavior);
|
||||
await MessengerService.SendTradeMessage(message, isBadBehavior, Account?.User);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,13 +1322,14 @@ public class TradingBot : Bot, ITradingBot
|
||||
var protectedIsForBacktest = Config.IsForBacktest;
|
||||
var protectedName = Config.Name;
|
||||
|
||||
// Log the configuration update
|
||||
await LogInformation($"Updating bot configuration. Previous config: " +
|
||||
$"Balance: {Config.BotTradingBalance}, " +
|
||||
$"MaxTime: {Config.MaxPositionTimeHours?.ToString() ?? "Disabled"}, " +
|
||||
$"FlipOnlyProfit: {Config.FlipOnlyWhenInProfit}, " +
|
||||
$"Cooldown: {Config.CooldownPeriod}, " +
|
||||
$"MaxLoss: {Config.MaxLossStreak}");
|
||||
// Log the configuration update (before changing anything)
|
||||
await LogInformation("⚙️ **Configuration Update**\n" +
|
||||
"📊 **Previous Settings:**\n" +
|
||||
$"💰 Balance: ${Config.BotTradingBalance:F2}\n" +
|
||||
$"⏱️ Max Time: {(Config.MaxPositionTimeHours?.ToString() + "h" ?? "Disabled")}\n" +
|
||||
$"📈 Flip Only in Profit: {(Config.FlipOnlyWhenInProfit ? "✅" : "❌")}\n" +
|
||||
$"⏳ Cooldown: {Config.CooldownPeriod} candles\n" +
|
||||
$"📉 Max Loss Streak: {Config.MaxLossStreak}");
|
||||
|
||||
// Update the configuration
|
||||
Config = newConfig;
|
||||
@@ -1351,12 +1352,13 @@ public class TradingBot : Bot, ITradingBot
|
||||
LoadScenario(Config.ScenarioName);
|
||||
}
|
||||
|
||||
await LogInformation($"Bot configuration updated successfully. New config: " +
|
||||
$"Balance: {Config.BotTradingBalance}, " +
|
||||
$"MaxTime: {Config.MaxPositionTimeHours?.ToString() ?? "Disabled"}, " +
|
||||
$"FlipOnlyProfit: {Config.FlipOnlyWhenInProfit}, " +
|
||||
$"Cooldown: {Config.CooldownPeriod}, " +
|
||||
$"MaxLoss: {Config.MaxLossStreak}");
|
||||
await LogInformation("✅ **Configuration Applied**\n" +
|
||||
"🔧 **New Settings:**\n" +
|
||||
$"💰 Balance: ${Config.BotTradingBalance:F2}\n" +
|
||||
$"⏱️ Max Time: {(Config.MaxPositionTimeHours?.ToString() + "h" ?? "Disabled")}\n" +
|
||||
$"📈 Flip Only in Profit: {(Config.FlipOnlyWhenInProfit ? "✅" : "❌")}\n" +
|
||||
$"⏳ Cooldown: {Config.CooldownPeriod} candles\n" +
|
||||
$"📉 Max Loss Streak: {Config.MaxLossStreak}");
|
||||
|
||||
// Save the updated configuration as backup
|
||||
if (!Config.IsForBacktest)
|
||||
|
||||
Reference in New Issue
Block a user