pull/1031/merge
ValueRaider 2023-07-30 19:31:40 +07:00 committed by GitHub
commit 9c921a540b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class TickerBase:
self._reconstruct_start_interval = None
@utils.log_indent_decorator
def history(self, period="1mo", interval="1d",
def history(self, period=None, interval="1d",
start=None, end=None, prepost=False, actions=True,
auto_adjust=True, back_adjust=False, repair=False, keepna=False,
proxy=None, rounding=False, timeout=10,
@ -93,6 +93,7 @@ class TickerBase:
period : str
Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
Either Use period parameter or use start and end
Default is '1mo'
interval : str
Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
Intraday data cannot extend last 60 days
@ -143,6 +144,14 @@ class TickerBase:
utils.print_once(f"yfinance: Ticker.history(debug={debug}) argument is deprecated and will be removed in future version. Do this instead to suppress error messages: logging.getLogger('yfinance').setLevel(logging.CRITICAL)")
logger.setLevel(logging.CRITICAL)
if period is not None and (start is not None or end is not None):
utils.print_once(f"yfinance: Ticker.history(): don't mix 'period' with 'start'/'end', am ignoring your dates")
start = None
end = None
if period is None and start is None and end is None:
# Manually handle 'period' default because need to know if user set period="1mo"
period = "1mo"
start_user = start
end_user = end
if start or period is None or period.lower() == "max":