update median price calculation for analyst

This commit is contained in:
MuslemRahimi 2024-11-21 11:22:43 +01:00
parent 8f3840aadb
commit 4d2356f48a

View File

@ -46,8 +46,8 @@ def get_summary(res_list):
# Filter the data for the last 12 months
filtered_data = [item for item in res_list if start_date_12m <= datetime.strptime(item['date'], '%Y-%m-%d').date() <= end_date]
# Filter the data for the last 12 months and consider the last N ratings
filtered_data = [item for item in res_list if start_date_12m <= datetime.strptime(item['date'], '%Y-%m-%d').date() <= end_date][:30]
# Initialize dictionary to store the latest price target for each analyst