feat: wavelets simulation
This commit is contained in:
@@ -160,12 +160,17 @@ def get_all_quotes() -> Dict[str, List[Dict[str, Any]]]:
|
||||
return result
|
||||
|
||||
|
||||
def get_historical(symbol: str, period: str = "1y", interval: str = "1d") -> List[Dict[str, Any]]:
|
||||
def get_historical(
|
||||
symbol: str, period: str = "1y", interval: str = "1d",
|
||||
start: Optional[str] = None, end: Optional[str] = None,
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""`start`/`end` (ISO date strings) take priority over `period` when given — yfinance
|
||||
only accepts one or the other, never both."""
|
||||
try:
|
||||
from urllib.parse import unquote
|
||||
symbol = unquote(symbol)
|
||||
ticker = yf.Ticker(symbol)
|
||||
hist = ticker.history(period=period, interval=interval)
|
||||
hist = ticker.history(start=start, end=end, interval=interval) if start else ticker.history(period=period, interval=interval)
|
||||
if hist.empty:
|
||||
return []
|
||||
hist = hist.reset_index()
|
||||
|
||||
Reference in New Issue
Block a user