Fix spot bot
This commit is contained in:
@@ -544,6 +544,18 @@ public class SpotBot : TradingBotBase, ITradingBot
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure account is loaded before accessing Account.Exchange
|
||||
if (Account == null)
|
||||
{
|
||||
Logger.LogWarning("Cannot update signals: Account is null. Loading account...");
|
||||
await LoadAccountAsync();
|
||||
if (Account == null)
|
||||
{
|
||||
Logger.LogError("Cannot update signals: Account failed to load");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Live trading: use ScenarioRunnerGrain to get signals
|
||||
await ServiceScopeHelpers.WithScopedService<IGrainFactory>(_scopeFactory, async grainFactory =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user