feat: quantcommon 가격 조회 시 기간(월) 파라미터 추가
This commit is contained in:
parent
fa03b48f47
commit
88e6f0eb91
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user