Spaces:
Running
Running
Update app.py
Browse filesFixed stocks closing date
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()
|
| 98 |
-
|
|
|
|
|
|
|
| 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,
|