Enhance FuturesBot logging and code readability
- Updated FuturesBot logging to include a prefix indicating the bot type for better clarity in logs. - Refactored signal retrieval code for improved readability by formatting the method call across multiple lines. - Minor whitespace adjustments to enhance code consistency.
This commit is contained in:
@@ -57,7 +57,7 @@ public class FuturesBot : TradingBotBase
|
||||
ExecutionCount++;
|
||||
|
||||
Logger.LogInformation(
|
||||
"[{CopyTrading}][{AgentName}] Bot Status {Name} - ServerDate: {ServerDate}, LastCandleDate: {LastCandleDate}, Signals: {SignalCount}, Executions: {ExecutionCount}, Positions: {PositionCount}",
|
||||
"[Future][{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);
|
||||
|
||||
@@ -714,11 +714,13 @@ public class FuturesBot : TradingBotBase
|
||||
await ServiceScopeHelpers.WithScopedService<IGrainFactory>(_scopeFactory, async grainFactory =>
|
||||
{
|
||||
var scenarioRunnerGrain = grainFactory.GetGrain<IScenarioRunnerGrain>(Guid.NewGuid());
|
||||
|
||||
|
||||
// Create indicator combo config from user settings
|
||||
var indicatorComboConfig = TradingBox.CreateConfigFromUserSettings(Account.User);
|
||||
|
||||
var signal = await scenarioRunnerGrain.GetSignals(Config, Signals, Account.Exchange, LastCandle, indicatorComboConfig);
|
||||
|
||||
var signal =
|
||||
await scenarioRunnerGrain.GetSignals(Config, Signals, Account.Exchange, LastCandle,
|
||||
indicatorComboConfig);
|
||||
if (signal == null) return;
|
||||
await AddSignal(signal);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user