dlflannery commited on
Commit
81859a5
·
verified ·
1 Parent(s): bdfde99

Update app.py

Browse files

Fixed stocks closing date

Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -94,8 +94,10 @@ def get_stock_report():
94
 
95
  def get_last_closing(symbol, timeout=10):
96
  try:
97
- today = datetime.today()+timedelta(days=1)
98
- five_days_ago = today - timedelta(days=5)
 
 
99
  end = today.strftime('%Y-%m-%d')
100
  start = five_days_ago.strftime('%Y-%m-%d')
101
  df = yf.download(symbol,
 
94
 
95
  def get_last_closing(symbol, timeout=10):
96
  try:
97
+ today = datetime.today()
98
+ if today.hour >= 16:
99
+ today = today + timedelta(days=1)
100
+ five_days_ago = today - timedelta(days=6)
101
  end = today.strftime('%Y-%m-%d')
102
  start = five_days_ago.strftime('%Y-%m-%d')
103
  df = yf.download(symbol,