Remove comments

This commit is contained in:
2025-11-26 10:38:24 +07:00
parent a93c738032
commit cef8073314

View File

@@ -73,10 +73,7 @@ public class TradingBotBase : ITradingBot
// Start async initialization in the background without blocking // Start async initialization in the background without blocking
try try
{ {
// Load account asynchronously
await LoadAccount(); await LoadAccount();
// Load last candle asynchronously
await LoadLastCandle(); await LoadLastCandle();
if (Account == null) if (Account == null)
@@ -85,16 +82,12 @@ public class TradingBotBase : ITradingBot
throw new ArgumentException("Account not found"); throw new ArgumentException("Account not found");
} }
// Cancel orders
// await CancelAllOrders();
// Send startup message only for fresh starts (not reboots)
switch (previousStatus) switch (previousStatus)
{ {
case BotStatus.Saved: case BotStatus.Saved:
var indicatorNames = Config.Scenario.Indicators.Select(i => i.Type.ToString()).ToList(); var indicatorNames = Config.Scenario.Indicators.Select(i => i.Type.ToString()).ToList();
var modeText = Config.IsForWatchingOnly ? "Watch Only" : var modeText = Config.IsForWatchingOnly ? "Watch Only" :
Config.IsForCopyTrading ? "Copy Trading" : "Live Trading"; Config.IsForCopyTrading ? "Copy Trading" : "Live Trading";
var startupMessage = $"🚀 Bot Started Successfully\n\n" + var startupMessage = $"🚀 Bot Started Successfully\n\n" +
$"📊 Trading Setup:\n" + $"📊 Trading Setup:\n" +
@@ -103,7 +96,9 @@ public class TradingBotBase : ITradingBot
$"🎮 Scenario: `{Config.Scenario?.Name ?? "Unknown"}`\n" + $"🎮 Scenario: `{Config.Scenario?.Name ?? "Unknown"}`\n" +
$"💰 Balance: `${Config.BotTradingBalance:F2}`\n" + $"💰 Balance: `${Config.BotTradingBalance:F2}`\n" +
$"👀 Mode: `{modeText}`\n\n" + $"👀 Mode: `{modeText}`\n\n" +
(Config.IsForCopyTrading ? "" : $"📈 Active Indicators: `{string.Join(", ", indicatorNames)}`\n\n") + (Config.IsForCopyTrading
? ""
: $"📈 Active Indicators: `{string.Join(", ", indicatorNames)}`\n\n") +
$"✅ Ready to monitor signals and execute trades\n" + $"✅ Ready to monitor signals and execute trades\n" +
$"📢 Notifications will be sent when positions are triggered"; $"📢 Notifications will be sent when positions are triggered";
@@ -255,7 +250,8 @@ public class TradingBotBase : ITradingBot
Logger.LogInformation( Logger.LogInformation(
"[{CopyTrading}][{AgentName}] Bot Status {Name} - ServerDate: {ServerDate}, LastCandleDate: {LastCandleDate}, Signals: {SignalCount}, Executions: {ExecutionCount}, Positions: {PositionCount}", "[{CopyTrading}][{AgentName}] Bot Status {Name} - ServerDate: {ServerDate}, LastCandleDate: {LastCandleDate}, Signals: {SignalCount}, Executions: {ExecutionCount}, Positions: {PositionCount}",
Config.IsForCopyTrading ? "CopyTrading" : "LiveTrading", Account.User.AgentName, Config.Name, DateTime.UtcNow, LastCandle?.Date, Signals.Count, ExecutionCount, Positions.Count); Config.IsForCopyTrading ? "CopyTrading" : "LiveTrading", Account.User.AgentName, Config.Name,
DateTime.UtcNow, LastCandle?.Date, Signals.Count, ExecutionCount, Positions.Count);
Logger.LogInformation("[{AgentName}] Internal Positions : {Position}", Account.User.AgentName, Logger.LogInformation("[{AgentName}] Internal Positions : {Position}", Account.User.AgentName,
string.Join(", ", string.Join(", ",