public Task StartAsync(CancellationToken cancellationToken)
        {
            _timers = new List <Timer>();
            _tasks  = new List <Task>();

            bufferFiggiesCandles = new BufferFiggiesCandles();
            _context             = _scope.ServiceProvider.GetRequiredService <TinkoffApiContext>();
            _service             = _scope.ServiceProvider.GetRequiredService <ITinkoffService>();

            return(Task.CompletedTask);
        }
        public TinkoffService(IConfiguration configuration, TinkoffApiContext context, Microsoft.Extensions.Hosting.IHostedService backgroundService)
        {
            _configuration     = configuration;
            _backgroundService = (BackgroundService)backgroundService;
            _context           = context;
            var mode = GetCurrentMode();

            _contextApi = new ContextApi(
                _configuration["Tinkoff:Sandbox:Token"], _configuration["Tinkoff:Bourse:Token"], mode
                );
            Connection();
        }