tedchou12 / webull

Unofficial APIs for Webull.
MIT License
597 stars 181 forks source link

get_bars premarket and after hours data broken #350

Open mdlivingston opened 1 year ago

mdlivingston commented 1 year ago

Hello, the get_bars call no longer grabs the premarket bars.. Please add a fix. I noticed the commit on September 27th is where it broke

K2083J commented 1 year ago

Hi, I am having the same issue. What is the fix?

mdlivingston commented 1 year ago

@K2083J , Go to webull.py and un comment line 1149 and then replace line 1152 with

response = requests.get(self._urls.bars(tId), params=params, headers=headers, timeout=self.timeout)

then go to endpoints.py and comment line 58

should work then!

aoyarceLenio commented 1 year ago

There is two things broken. The 'extendTrading' for pre and after hour data and 'timeStamp' for the historical bars.

aoyarceLenio commented 1 year ago

I made a little test and this also work, without the need of change anything else:

    params = {"extendTrading": extendTrading, "timestamp": timeStamp}
    response = requests.get(self._urls.bars(tId, interval, count), params=params, headers=headers, timeout=self.timeout)

It fix the timestamp for historical bars, and extended hours candles.

aoyarceLenio commented 1 year ago

@tedchou12 Hello, please your help with this.