From c39bc7984d40a55c9b13bc8eb138ff6016aa1558 Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Sat, 8 Feb 2025 07:47:28 -0800 Subject: [PATCH] feat: Move get_interval_choice function to user_input.py from t_sunnyband.py --- src/screener/t_sunnyband.py | 23 ----------------------- src/screener/user_input.py | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/screener/t_sunnyband.py b/src/screener/t_sunnyband.py index 694c63f..018305f 100644 --- a/src/screener/t_sunnyband.py +++ b/src/screener/t_sunnyband.py @@ -7,29 +7,6 @@ from db.db_connection import create_client from indicators.sunny_bands import SunnyBands from trading.position_calculator import PositionCalculator -def get_interval_choice() -> str: - """Get user's preferred time interval""" - print("\nSelect Time Interval:") - print("1. Daily") - print("2. 5 minute") - print("3. 15 minute") - print("4. 30 minute") - print("5. 1 hour") - - while True: - choice = input("\nEnter your choice (1-5): ") - if choice == "1": - return "daily" - elif choice == "2": - return "5min" - elif choice == "3": - return "15min" - elif choice == "4": - return "30min" - elif choice == "5": - return "1hour" - else: - print("Invalid choice. Please try again.") def get_stock_data(ticker: str, start_date: datetime, end_date: datetime, interval: str) -> pd.DataFrame: """Fetch stock data from the database""" diff --git a/src/screener/user_input.py b/src/screener/user_input.py index 7a191b8..b28a6d8 100644 --- a/src/screener/user_input.py +++ b/src/screener/user_input.py @@ -1,6 +1,28 @@ from screener.screeners import SCREENERS # Import SCREENERS dictionary -def get_user_screener_selection(): +def get_interval_choice() -> str: + """Get user's preferred time interval""" + print("\nSelect Time Interval:") + print("1. Daily") + print("2. 5 minute") + print("3. 15 minute") + print("4. 30 minute") + print("5. 1 hour") + + while True: + choice = input("\nEnter your choice (1-5): ") + if choice == "1": + return "daily" + elif choice == "2": + return "5min" + elif choice == "3": + return "15min" + elif choice == "4": + return "30min" + elif choice == "5": + return "1hour" + else: + print("Invalid choice. Please try again.") """ Ask the user which screeners they want to run and whether to use defaults. Returns a dictionary of selected screeners with default/customization choices.