From f8da0e49f48e51fcd777ef04193862cb8d7874ab Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 8 Mar 2025 01:22:00 +0100 Subject: [PATCH] bugfixing --- app/cron_analyst_ticker.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/cron_analyst_ticker.py b/app/cron_analyst_ticker.py index dd13798..dfbd929 100755 --- a/app/cron_analyst_ticker.py +++ b/app/cron_analyst_ticker.py @@ -147,10 +147,13 @@ def get_all_analyst_summary(res_list): data_dict = {key: 0 for key in rating_hierarchy.keys()} for r in consensus_ratings.values(): data_dict[r] += 1 - buy_total = data_dict.get('Strong Buy', 0) + data_dict.get('Buy', 0) - sell_total = data_dict.get('Strong Sell', 0) + data_dict.get('Sell', 0) - hold_total = data_dict.get('Hold', 0) + strong_buy_total = data_dict.get('Strong Buy', 0) + buy_total = data_dict.get('Buy', 0) + sell_total = data_dict.get('Strong Sell', 0) + data_dict.get('Sell', 0) + strong_sell_total = data_dict.get('Strong Sell', 0) + hold_total = data_dict.get('Hold', 0) + # Count unique analysts numOfAnalyst = len(unique_filtered_data) @@ -165,7 +168,7 @@ def get_all_analyst_summary(res_list): 'recommendationList': recommendation_list } - categorical_ratings = {'Buy': buy_total, 'Sell': sell_total, 'Hold': hold_total} + categorical_ratings = {'strongBuy': strong_buy_total, 'buy': buy_total, 'sell': sell_total, 'strongSell': strong_sell_total, 'hold': hold_total} res = {**stats, **categorical_ratings} return res