Add spot trading
This commit is contained in:
@@ -531,7 +531,14 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
||||
using var scope = _scopeFactory.CreateScope();
|
||||
var logger = scope.ServiceProvider.GetRequiredService<ILogger<TradingBotBase>>();
|
||||
var streamProvider = this.GetStreamProvider("ManagingStreamProvider");
|
||||
var tradingBot = new FuturesBot(logger, _scopeFactory, config, streamProvider);
|
||||
|
||||
// Create the trading bot instance based on TradingType
|
||||
TradingBotBase tradingBot = config.TradingType switch
|
||||
{
|
||||
TradingType.Futures => new FuturesBot(logger, _scopeFactory, config, streamProvider),
|
||||
TradingType.Spot => new SpotBot(logger, _scopeFactory, config, streamProvider),
|
||||
_ => throw new InvalidOperationException($"Unsupported TradingType for live trading: {config.TradingType}")
|
||||
};
|
||||
|
||||
// Load state into the trading bot instance
|
||||
LoadStateIntoTradingBot(tradingBot);
|
||||
|
||||
Reference in New Issue
Block a user