get_all_ohlcv_for_date#

pyqqq.data.us_stocks.get_all_ohlcv_for_date(date: date) DataFrame[source]#

주어진 날짜에 대한 모든 미국 주식의 OHLCV(Open, High, Low, Close, Volume) 데이터를 조회합니다.

이 함수는 특정 날짜에 대한 모든 미국 주식의 시가, 고가, 저가, 종가 및 거래량 데이터를 API를 통해 요청하고, 이를 pandas DataFrame 형태로 반환합니다. 반환된 DataFrame은 ‘ticker’를 인덱스로 사용합니다.

Parameters:

date (dtm.date) – 조회할 날짜.

Returns:

OHLCV 데이터를 포함하는 DataFrame. ‘ticker’ 컬럼은 DataFrame의 인덱스로 설정됩니다.

DataFrame의 컬럼은 다음과 같습니다:

  • open (float): 시가

  • high (float): 고가

  • low (float): 저가

  • close (float): 종가

  • volume (int): 거래량

Return type:

pd.DataFrame

Raises:

HTTPError – API 요청이 실패했을 때 발생

Examples

>>> ohlcv_data = get_all_ohlcv_for_date(dtm.date(2024, 5, 8))
>>> print(ohlcv_data)
        open    high     low   close     volume
ticker
AAPL    173.9  174.8   173.1  174.2  48521234
MSFT    419.2  420.7   416.3  418.5  22145678
GOOGL   142.5  143.8   141.9  143.2  15234567
AMZN    178.2  179.5   177.4  178.8  32456789
META    435.1  437.2   433.6  436.4  18234567
...