Skip to content

Commit

Permalink
update options 0dte flow
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Jul 11, 2024
1 parent 3d22151 commit 10e61eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/cron_options_zero_dte.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']

if item['date_expiration'] == start_date:
page_list.append(item)
Expand Down
Binary file modified app/ml_models/__pycache__/classification.cpython-310.pyc
Binary file not shown.

0 comments on commit 10e61eb

Please sign in to comment.