infinite log generation and high CPU usage running notebook with Schwab
Expected Behavior
To run a local research notebook, using Schwab as the broker for data.
Actual Behavior
I'm running a local research instance in a notebook, and using QC to get data from Schwab. For some reason the notebook cell seems to keep updating and/or interacting with Schwab (or some other process ?) literally every second , even though I'm doing nothing. It keeps on printing "Starting re-subscription process..., etc." The result is a very long and scrolling list of TRACE log messages which doesn't seem like correct behavior ( see red rectangle in screenshot - this area keeps scrolling and generating a huge log independently, while the corresponding notebook cell keeps recalculating automatically.
Is this expected behavior ? Note that the data history requests do seem to work, so the broker connection "works", but the output is continuous and voluminous, making it distracting and hard to see what work I'm doing on the notebook itself. This scrolling output prints to the terminal, which is replicated in the notebook output cell (see screenshot). Note also that CPU usage is high; The task manager also shows abnormal CPU for the notebook , even with no cell computation going on ( not great on a laptop 🙂
Potential Solution
Reproducing the Problem
-
Run the shell command:
lean research "<project name>" --no-update --no-open --data-provider-historical CharlesSchwab --charles-schwab-account-number xxxxxxxx (account # redacted) -
Connect to the research server in vscode.
-
Run the first cell to import quantbook, i.e.:
qb = QuantBook()or run any subsequent history() request, for example:
spy = qb.add_equity("SPY", data_normalization_mode=DataNormalizationMode.RAW)
history = qb.history(qb.securities.keys(), 3, Resolution.DAILY)
history
(note the cell will keep recomputing every 1-2 seconds, for some reason)
System Information
System: Windows 11, Version 10.0.26100 Build 26100 Surface Laptop 5
Checklist
- [ y] I have completely filled out this template
- [ y] I have confirmed that this issue exists on the current
masterbranch - [ y] I have confirmed that this is not a duplicate issue by searching issues
- [ y] I have provided detailed steps to reproduce the issue