tedchou12 / webull

Unofficial APIs for Webull.
MIT License
602 stars 185 forks source link

How to download *multiple* tickers in one request? #327

Closed alexh0101 closed 2 years ago

alexh0101 commented 2 years ago

Trying to do a get_bar() for multiple tickers.

Is there a built-in way for doing that?

Or should I do some kind of async/multithreading? If so, how should I go about it (which package)?

ICANTFINDAUSERNAMEATALL commented 2 years ago

you can just run a for loop with all the bars. multicoring doesn't work for me but multithreading might.

tedchou12 commented 2 years ago

@alexh0101 You can take a look at this one: https://realpython.com/intro-to-python-threading/

But unless is necessary, I don't recommend it. I use it myself because the download IO requests doesn't take up CPU, so running APIs reaches IO bottleneck.