mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 15:17:28 +00:00
update for OTC
This commit is contained in:
parent
a4948fd566
commit
3e4945cffd
@ -157,7 +157,6 @@ class IEX_Symbol:
|
|||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
IEXData = response.json()
|
IEXData = response.json()
|
||||||
keys = (
|
keys = (
|
||||||
"isUSMarketOpen",
|
|
||||||
"extendedChangePercent",
|
"extendedChangePercent",
|
||||||
"extendedPrice",
|
"extendedPrice",
|
||||||
"companyName",
|
"companyName",
|
||||||
@ -167,13 +166,10 @@ class IEX_Symbol:
|
|||||||
|
|
||||||
if set(keys).issubset(IEXData):
|
if set(keys).issubset(IEXData):
|
||||||
|
|
||||||
try: # Some symbols dont return if the market is open
|
|
||||||
IEXData["isUSMarketOpen"]
|
|
||||||
except KeyError:
|
|
||||||
IEXData["isUSMarketOpen"] = True
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
IEXData["isUSMarketOpen"]
|
IEXData.get("isUSMarketOpen", True)
|
||||||
or (IEXData["extendedChangePercent"] is None)
|
or (IEXData["extendedChangePercent"] is None)
|
||||||
or (IEXData["extendedPrice"] is None)
|
or (IEXData["extendedPrice"] is None)
|
||||||
): # Check if market is open.
|
): # Check if market is open.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user