1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-07-25 23:51:32 +00:00
This commit is contained in:
2021-06-22 00:08:04 -07:00
parent 55bf78a57b
commit 6baf893823
3 changed files with 28 additions and 11 deletions

View File

@@ -476,7 +476,7 @@ class IEX_Symbol:
return pd.DataFrame()
def trending(self) -> list[str]:
"""Gets current coins trending on IEX. Only returns when market is open.
"""Gets current coins trending on IEX. Only returns when market is open.
Returns
-------
@@ -489,6 +489,9 @@ class IEX_Symbol:
timeout=5,
)
if stocks.status_code == 200:
return [f"${s['symbol']}: {s['companyName']}" for s in stocks.json()]
return [
f"`${s['symbol']}`: {s['companyName']}, {s['changePercent']:.2f}%"
for s in stocks.json()
]
else:
return ["Trending Stocks Currently Unavailable."]