Fix loading backup
This commit is contained in:
@@ -52,7 +52,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
IBotService botService,
|
||||
TradingBotConfig config
|
||||
)
|
||||
: base(config.AccountName)
|
||||
: base(config.Name)
|
||||
{
|
||||
ExchangeService = exchangeService;
|
||||
AccountService = accountService;
|
||||
@@ -85,17 +85,17 @@ public class TradingBot : Bot, ITradingBot
|
||||
}
|
||||
}
|
||||
|
||||
public override async void Start()
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
// Load account synchronously
|
||||
await LoadAccount();
|
||||
LoadAccount().GetAwaiter().GetResult();
|
||||
|
||||
if (!Config.IsForBacktest)
|
||||
{
|
||||
LoadScenario(Config.ScenarioName);
|
||||
await PreloadCandles();
|
||||
await CancelAllOrders();
|
||||
PreloadCandles().GetAwaiter().GetResult();
|
||||
CancelAllOrders().GetAwaiter().GetResult();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -109,7 +109,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
Logger.LogError(ex, ex.Message);
|
||||
}
|
||||
|
||||
await InitWorker(Run);
|
||||
InitWorker(Run).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
// Fee = TradingService.GetFee(Account, IsForBacktest);
|
||||
@@ -1010,6 +1010,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
BotTradingBalance = data.BotTradingBalance,
|
||||
BotType = data.BotType,
|
||||
CooldownPeriod = data.CooldownPeriod,
|
||||
Name = data.Name
|
||||
};
|
||||
|
||||
Signals = data.Signals;
|
||||
|
||||
Reference in New Issue
Block a user