jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.69k stars 459 forks source link

Delay in fetching correct open price as soon as market opens #165

Open Prasanth777 opened 4 years ago

Prasanth777 commented 4 years ago

Hi,

I recently encountered a problem where the previous close price is fetched as open price right after the market opens for about 30-40 secs. After 40 secs, it gives the correct open price. Here is a simple code for verification:

def stock_fundamentals(stock_name):
    stock_fund = r.stocks.get_fundamentals(stock_name, info=None)
while True:
        stock_fundamentals('LUB')  
        time.sleep(2)

Here are the relevant logs:

INFO 2020-09-09 09:29:53,780 - Open price of 'LUB' is '1.89' INFO 2020-09-09 09:29:56,344 - Open price has been retreived successfully INFO 2020-09-09 09:29:56,345 - Open price of 'LUB' is '1.89' INFO 2020-09-09 09:29:59,058 - Open price has been retreived successfully INFO 2020-09-09 09:29:59,059 - Open price of 'LUB' is '1.89' INFO 2020-09-09 09:30:01,827 - Open price has been retreived successfully INFO 2020-09-09 09:30:01,827 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:04,512 - Open price has been retreived successfully INFO 2020-09-09 09:30:04,513 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:07,178 - Open price has been retreived successfully INFO 2020-09-09 09:30:07,178 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:09,822 - Open price has been retreived successfully INFO 2020-09-09 09:30:09,823 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:12,539 - Open price has been retreived successfully INFO 2020-09-09 09:30:12,539 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:15,086 - Open price has been retreived successfully INFO 2020-09-09 09:30:15,086 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:17,765 - Open price has been retreived successfully INFO 2020-09-09 09:30:17,765 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:20,359 - Open price has been retreived successfully INFO 2020-09-09 09:30:20,360 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:22,949 - Open price has been retreived successfully INFO 2020-09-09 09:30:22,950 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:25,582 - Open price has been retreived successfully INFO 2020-09-09 09:30:25,582 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:28,304 - Open price has been retreived successfully INFO 2020-09-09 09:30:28,305 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:30,941 - Open price has been retreived successfully INFO 2020-09-09 09:30:30,942 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:33,556 - Open price has been retreived successfully INFO 2020-09-09 09:30:33,556 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:36,307 - Open price has been retreived successfully INFO 2020-09-09 09:30:36,308 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:38,941 - Open price has been retreived successfully INFO 2020-09-09 09:30:38,942 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:41,494 - Open price has been retreived successfully INFO 2020-09-09 09:30:41,494 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:44,310 - Open price has been retreived successfully INFO 2020-09-09 09:30:44,310 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:46,948 - Open price has been retreived successfully INFO 2020-09-09 09:30:46,948 - Open price of 'LUB' is '2.22' INFO 2020-09-09 09:30:49,494 - Open price has been retreived successfully INFO 2020-09-09 09:30:49,495 - Open price of 'LUB' is '1.94' INFO 2020-09-09 09:30:52,062 - Open price has been retreived successfully INFO 2020-09-09 09:30:52,062 - Open price of 'LUB' is '1.94' INFO 2020-09-09 09:30:54,824 - Open price has been retreived successfully INFO 2020-09-09 09:30:54,824 - Open price of 'LUB' is '1.94'

Here, the correct open price of LUB was $1.94 which was received at 09:30:49. $2.22 was the previous close price, which was returned as open price in the in-between interval. This behavior is happening for the past 1 week. It was fine before that.

Thanks.

unrealgecko commented 4 years ago

robinhood is slow to update. especially during busy mornings and this past week has been super sluggish for orders and info out of robinhoods API.