feat: Move get_interval_choice function to user_input.py from t_sunnyband.py

This commit is contained in:
Bobby (aider) 2025-02-08 07:47:28 -08:00
parent df4ee34b3a
commit c39bc7984d
2 changed files with 23 additions and 24 deletions

View File

@ -7,29 +7,6 @@ from db.db_connection import create_client
from indicators.sunny_bands import SunnyBands from indicators.sunny_bands import SunnyBands
from trading.position_calculator import PositionCalculator 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: def get_stock_data(ticker: str, start_date: datetime, end_date: datetime, interval: str) -> pd.DataFrame:
"""Fetch stock data from the database""" """Fetch stock data from the database"""

View File

@ -1,6 +1,28 @@
from screener.screeners import SCREENERS # Import SCREENERS dictionary 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. Ask the user which screeners they want to run and whether to use defaults.
Returns a dictionary of selected screeners with default/customization choices. Returns a dictionary of selected screeners with default/customization choices.