bugfixing
This commit is contained in:
parent
e591fd2bd3
commit
2c6e38137c
@ -12,6 +12,10 @@ from functools import partial
|
||||
import asyncio
|
||||
import aiohttp
|
||||
|
||||
|
||||
today = datetime.today().date()
|
||||
|
||||
|
||||
load_dotenv()
|
||||
|
||||
api_key = os.getenv('UNUSUAL_WHALES_API_KEY')
|
||||
@ -92,7 +96,7 @@ def prepare_data(data, symbol):
|
||||
if float(item['volume']) > 0:
|
||||
# Parse option_symbol
|
||||
date_expiration, option_type, strike_price = parse_option_symbol(item['option_symbol'])
|
||||
|
||||
if date_expiration >= today:
|
||||
# Round numerical and numerical-string values
|
||||
new_item = {
|
||||
key: safe_round(value) if isinstance(value, (int, float, str)) else value
|
||||
@ -130,6 +134,7 @@ def get_hottest_contracts():
|
||||
response = requests.get(url, headers=headers)
|
||||
if response.status_code == 200:
|
||||
data = response.json()['data']
|
||||
|
||||
prepare_data(data, symbol)
|
||||
|
||||
counter +=1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user