Skip to content

Commit

Permalink
update options flow
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Jul 11, 2024
1 parent e05df54 commit 4e0bb15
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/cron_options_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def process_page(page):
try:
data = fin.options_activity(date_from=start_date, date_to=end_date, page=page, pagesize=1000)
data = ujson.loads(fin.output(data))['option_activity']
filtered_data = [{key: value for key, value in item.items() if key in ['ticker','time', 'id','sentiment','underlying_price', 'cost_basis', 'underlying_price','option_activity_type','date', 'date_expiration', 'open_interest','price', 'put_call','strike_price', 'volume']} for item in data]
filtered_data = [{key: value for key, value in item.items() if key not in ['description_extended','updated']} for item in data]
time.sleep(1)
page_list = []
for item in filtered_data:
Expand All @@ -59,6 +59,8 @@ def process_page(page):
item['underlying_price'] = round(float(item['underlying_price']), 2)
item['type'] = item['option_activity_type'].capitalize()
item['sentiment'] = item['sentiment'].capitalize()
item['executionEstimate'] = item['execution_estimate'].replace('_', ' ').title()
item['tradeCount'] = item['trade_count']

page_list.append(item)

Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ async def get_earnings_call_transcripts(data:TranscriptData):
quarter = data['quarter']
cache_key = f"earnings-call-transcripts-{ticker}-{year}-{quarter}"
cached_result = redis_client.get(cache_key)

if cached_result:
return ujson.loads(cached_result)

Expand All @@ -1987,7 +1988,6 @@ async def get_earnings_call_transcripts(data:TranscriptData):
content = remove_text_before_operator(data['content'])
chat = extract_names_and_descriptions(content)
res = {'date': data['date'], 'chat': chat}

except:
res = {}

Expand Down
Binary file modified app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc
100755 → 100644
Binary file not shown.
Binary file modified app/ml_models/__pycache__/prophet_model.cpython-310.pyc
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion app/ml_models/fundamental_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,4 @@ async def main():
con.close()

# Run the main function
asyncio.run(main())
#asyncio.run(main())

0 comments on commit 4e0bb15

Please sign in to comment.