feat: Integrate I_Score for institutional sponsorship in CANSLIM screener
This commit is contained in:
parent
f62cd47292
commit
c0285bb0c7
@ -3,6 +3,7 @@ from screener.data_fetcher import validate_date_range, fetch_financial_data, get
|
||||
from screener.c_canslim import check_quarterly_earnings, check_return_on_equity, check_sales_growth
|
||||
from screener.a_canslim import check_annual_eps_growth
|
||||
from screener.l_canslim import check_industry_leadership # ✅ NEW: Import L Score function
|
||||
from screener.i_canslim import check_institutional_sponsorship # ✅ NEW: Import I Score function
|
||||
from screener.csv_appender import append_scores_to_csv
|
||||
from screener.screeners import SCREENERS # Import categories
|
||||
from screener.user_input import get_user_screener_selection # Import function
|
||||
@ -52,6 +53,9 @@ def main():
|
||||
elif screener == "L_Score":
|
||||
scores[screener] = check_industry_leadership(symbol) # ✅ NEW: Industry Leadership Calculation
|
||||
print(f"🟢 {symbol} - L_Score: {scores[screener]}") # ✅ DEBUG LOG
|
||||
elif screener == "I_Score":
|
||||
scores[screener] = check_institutional_sponsorship(symbol) # ✅ NEW: Institutional Sponsorship Check
|
||||
print(f"🏢 {symbol} - I_Score: {scores[screener]}") # ✅ DEBUG LOG
|
||||
|
||||
# Apply user-defined threshold if applicable
|
||||
if isinstance(threshold, (int, float)):
|
||||
|
||||
@ -30,6 +30,8 @@ def append_scores_to_csv(symbol, scores):
|
||||
headers = existing_headers if existing_headers else new_headers
|
||||
if "L_Score" not in headers:
|
||||
headers.insert(-1, "L_Score") # Ensure L_Score is before Total_Score
|
||||
if "I_Score" not in headers:
|
||||
headers.insert(-1, "I_Score") # Ensure I_Score is before Total_Score
|
||||
|
||||
# Ensure order consistency for output
|
||||
row_data = {header: scores.get(header, 0) for header in headers}
|
||||
|
||||
@ -5,7 +5,8 @@ SCREENERS = {
|
||||
"Annual_EPS_Score": "Checks 3-year annual EPS growth",
|
||||
"Sales_Score": "Checks quarterly sales growth",
|
||||
"ROE_Score": "Checks return on equity",
|
||||
"L_Score": "Checks if the stock is a leader in its industry" # ✅ NEW: Added L_Score
|
||||
"L_Score": "Checks if the stock is a leader in its industry", # ✅ NEW: Added L_Score
|
||||
"I_Score": "Checks institutional sponsorship and ownership trends" # ✅ NEW: Added I_Score
|
||||
},
|
||||
"Volume-Based": {
|
||||
"Volume_Oscillator_Score": "Checks for unusual volume surges",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user