feat: quantcommon 가격 조회 시 기간(월) 파라미터 추가

This commit is contained in:
Ayuriel 2025-03-10 18:27:00 +09:00
parent fa03b48f47
commit 88e6f0eb91

View File

@ -55,14 +55,14 @@ class QuantCommon:
return value_list
def get_price_list(self):
def get_price_list(self, interval_month):
engine = self.create_engine()
try:
price_list = pd.read_sql("""
price_list = pd.read_sql(f"""
select 날짜, 종가, 종목코드
from kor_price
where 날짜 >= (select (select max(날짜) from kor_price) - interval 1 year);
where 날짜 >= (select (select max(날짜) from kor_price) - interval {interval_month} month);
""", con=engine)
finally:
engine.dispose()