File tree 1 file changed +10
-2
lines changed
MachineLearning Projects/Stock-Analysis
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,20 @@ def get_ticker_list():
21
21
except ValueError :
22
22
print ("Please input a valid integer only." )
23
23
24
+ # Function to get the time period for analysis
25
+ def get_time_period ():
26
+ try :
27
+ start_date = input ("Enter the start date (YYYY-MM-DD): " )
28
+ end_date = input ("Enter the end date (YYYY-MM-DD): " )
29
+ return start_date , end_date
30
+ except ValueError :
31
+ print ("Invalid date format. Please use the format YYYY-MM-DD." )
32
+
24
33
# Main function
25
34
def main ():
26
35
tickerlist = get_ticker_list ()
27
36
28
- end_date = datetime .today ().strftime ('%Y-%m-%d' )
29
- start_date = (datetime .today () - timedelta (days = 365 )).strftime ('%Y-%m-%d' )
37
+ start_date , end_date = get_time_period () # Get time period for analysis
30
38
31
39
data = pd .DataFrame ()
32
40
You can’t perform that action at this time.
0 commit comments