public ITradeBot Build() { this._configureServicesDelegate(this._serviceCollection); this._serviceCollection.AddSingleton <IConfiguration>(this._configuration); this._serviceProvider = this._serviceCollection.BuildServiceProvider(); this._options = new TradeBotOptions(this._configuration); var logger = this._serviceProvider.GetRequiredService <ILogger <TradeBot> >(); var loggerFactory = this._serviceProvider.GetRequiredService <ILoggerFactory>(); this._logger = logger; var tradeFlowAnalyzer = this.AnalyzeTradeFlow(); this._options.TradeAccounts = tradeFlowAnalyzer.TradeAccounts; this._options.BuyAccount = tradeFlowAnalyzer.BuyAccount; this._options.SellAccount = tradeFlowAnalyzer.SellAccount; this._options.CapPublisher = this._capPublisher; var emailHelper = this._serviceProvider.GetRequiredService <IEmailHelper>(); GlobalConfiguration.Configuration.UseSqlServerStorage(this._configuration["Hangfire:ConnectionString"]); var hangfireServer = new BackgroundJobServer(); var tradeBot = new TradeBot( this._options, logger, loggerFactory, emailHelper, hangfireServer); return(tradeBot); }
public ITradeBot Build() { this._options = new TradeBotOptions(this._configuration); var tradeFlowAnalyzer = this.AnalyzeTradeFlow(); this._options.BuyAccount = tradeFlowAnalyzer.BuyAccount; this._options.SellAccount = tradeFlowAnalyzer.SellAccount; var tradeBot = new TradeBot(_options); return(tradeBot); }
public TradeBot( TradeBotOptions options, ILogger <TradeBot> logger, ILoggerFactory loggerFactory, IEmailHelper emailHelper, BackgroundJobServer hangfireServer) { this._timeLeftToSendEmail = 0; this._options = options; this._logger = logger; this._emailHelper = emailHelper; this._loggerFactory = loggerFactory; this._hangfireServer = hangfireServer; this._logger.LogInformation("Bot is created successfully"); }
public TradeBot(TradeBotOptions options) { this._timeLeftToSendEmail = 0; this._options = options; }
public TradeInfoAnalyzer( TradeBotOptions tradeOptions) { this._options = tradeOptions; }