diff --git a/quantcommon.py b/quantcommon.py index a2cea81..fbb8c14 100644 --- a/quantcommon.py +++ b/quantcommon.py @@ -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()