Convert today's date to a date object rather than a string

This commit is contained in:
moshferatu 2024-11-11 09:37:17 -08:00
parent b518115791
commit d10a889e9b

View File

@ -11,7 +11,7 @@ def get_daily_data(symbol: str, start_date: datetime = datetime.today() - timede
The daily bar is not available for the current day until after market close.
It must be calculated using intraday (e.g., 5-minute) bars while the market is open.
"""
today = datetime.today().strftime('%Y-%m-%d')
today = datetime.today().date()
if today not in daily_data['Date'].values:
intraday_data = ohlc(symbol = symbol, minutes = 5)