From 4e0bb15c83e8fa9ba27a85de41458a1fbb795499 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 11 Jul 2024 14:58:14 +0200 Subject: [PATCH] update options flow --- app/cron_options_flow.py | 4 +++- app/main.py | 2 +- .../fundamental_predictor.cpython-310.pyc | Bin 10924 -> 10781 bytes .../__pycache__/prophet_model.cpython-310.pyc | Bin 2742 -> 2732 bytes app/ml_models/fundamental_predictor.py | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc mode change 100755 => 100644 app/ml_models/__pycache__/prophet_model.cpython-310.pyc diff --git a/app/cron_options_flow.py b/app/cron_options_flow.py index aa4b8be..30689c6 100755 --- a/app/cron_options_flow.py +++ b/app/cron_options_flow.py @@ -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: @@ -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) diff --git a/app/main.py b/app/main.py index 9ed2a2e..b1d44ac 100755 --- a/app/main.py +++ b/app/main.py @@ -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) @@ -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 = {} diff --git a/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc b/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc old mode 100755 new mode 100644 index ec1c98d91a3e0a3d0275fab53e18fe24a2e76b3c..f538d97096fb50cfd0e5a6d28457788ed10c598a GIT binary patch delta 3698 zcmbtXZEPGz8J^kOyWQLS$l1O--<=)%lKAV=P}(MGllI~`rTL;th!mPOP1DQyX6>AF zcWckCliJ$DiJY`4#3g7@)Rcnm$`2GNP!$6LAyE`SfJ0;=UhEkCFPLP8)Rl_JFZ z&N;TRC`uJu`|LaKJoA3e?C#xs;>(|oT9JrB;P0Kq&yU@=VSX04NZi0pLtA15S21*ENQN#M`Vu3w ziVsA>Fv6y6pBqOxMXj{byvv$b{OGeo7I{`>4 z;%IKb)m+^Tx`rEa!}E~J$!tC9M#W7v80<)sddywd(8Ukb&be>8?QX=4rHR{?CsVIY zy*%|rC+J2RMiUDZaY7Sem$-`SV{w*PP#cjZsdu;?6H%6A9jx7=BVa3G|X8#i%ANfVZY@C@uRTR*SVQ*H{v z>d9Bh)Nh=)8)3aHdy%jW3ku{+8VNVjq>Uuxns(EyCruiiY$N0)DM$T;1|z?zJkd6FC@Dsj55(iw}AdKV?LA*Wl61bS(oI2HJ-Xa>{bs`l^D{jgs- z!aw(k>w2%arEjI%#Xt0e16x7qsb$Bk%J~*Nh)N@0DcerTs!k4X7iRES$41cR0(=wP z4)Z=h-YVi%ac4WBI~ZuN5m`ZPGw|PkD}2}AUuX3eeM(S*rud( zcMRA2&lW4wrl+tmJ}eH!wjTzd7(Q?gXo+byAGafb9#uQ=Jxmv|4vH~kQ#Vpve zD*(!Qm8!Ho7*`Zu)GywO73d}L@wWGSuE6A48+xHou9claVNUF8-%s=6rS>h`eN1Bt z^D!0QUJL#vrNpHT#Zlp16?FWK05h7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6b@>U$FhqjOkvqI3Gt^4&fYfLwUQLH{HgB zha9ssU$poPHp{iVF?>eS54(kMehw;xUlzswz4WShy?@tszpXJ%n`cz!{8u!B1MDXn z+s@in`M&sf{}k;JQv=_r-a^i%p+&Yj_0%E$H*Ao}M(!lWqp*}^T5{Z*QjxQ4L>lAY zj!ZfJawa(yHe=k^mZl43T-n?L zo*$Yw%gl730LAU$N9dcYeIsWnjfslUv!f5gI0LN4JmCW4@UMo*F_ZQ-1<_a_;yvSu M@EL7R8;&Rc16y;TQvd(} diff --git a/app/ml_models/__pycache__/prophet_model.cpython-310.pyc b/app/ml_models/__pycache__/prophet_model.cpython-310.pyc old mode 100755 new mode 100644 index 4b655e812cad7531e09c0d3f56d57ed53b43e699..7fc825e592c803e6d5b1c3f2d754c25fe2296754 GIT binary patch delta 31 lcmdlcx<-^cpO=@50SK0F>EFoh%*1Fn*`G;%a|M$f2LOH^2g?8e delta 42 wcmZ1@x=oZjpO=@50SNx>vDnD%%*5z1*`G