From 5ccba7e28620ae2b8dd79e1efa587cedf9fcec74 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sat, 17 Sep 2022 21:58:36 +0900 Subject: [PATCH] init --- Simulation.py | 10 +++------- stock/analysis/AnalyzerSqlite.py | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Simulation.py b/Simulation.py index dbd0279..b67d10e 100644 --- a/Simulation.py +++ b/Simulation.py @@ -203,17 +203,13 @@ if __name__ == "__main__": # to check bying stock_codes = { - "122630": [ - '20220801', '20220802', '20220803', '20220804', '20220805', - '20220808', '20220809', '20220810', '20220811', '20220812', - '20220816', '20220817', '20220818', '20220819', '20220822', - '20220823', '20220824', '20220825', '20220826', '20220829', - '20220830', '20220831', + "252670": [ '20220901', '20220902', '20220905', '20220906', '20220907', - '20220908' + '20220908','20220913','20220914','20220915','20220916' ] } """ + # 122630 "252670": [ '20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811', '20220812', diff --git a/stock/analysis/AnalyzerSqlite.py b/stock/analysis/AnalyzerSqlite.py index 73a4baf..80302aa 100644 --- a/stock/analysis/AnalyzerSqlite.py +++ b/stock/analysis/AnalyzerSqlite.py @@ -272,7 +272,7 @@ class AnalyzerSqlite: self.makeDir("weekly_4주선_48주선_상향돌파") self.makeDir("weekly_종가_12주선_상향돌파") - self.makeDir("weekly_rsi_20이하") + self.makeDir("weekly_rsi_25이하") self.makeDir("weekly_rsi_rsis_위로_올라옴") self.makeDir("weekly_BB하단_내려옴") @@ -280,7 +280,7 @@ class AnalyzerSqlite: self.makeDir("daily_종가_60일선_상향돌파") self.makeDir("daily_3일선_10일선_상향돌파") self.makeDir("daily_3일선_10일선_하향돌파") - self.makeDir("daily_rsi_10이하") + self.makeDir("daily_rsi_25이하") self.makeDir("daily_이전에_없던_거래량") self.makeDir("daily_이격도") @@ -472,7 +472,7 @@ class AnalyzerSqlite: type = "monthly_6월선_36월선_상향돌파" final_status += " " + type final_status_count += 1 - self.writeFile(type, CODE, NAME, top, stock_weekly, status) + self.writeFile(type, CODE, NAME, top, stock_monthly, status) # 종가가 20주선을 상향 돌파함 if len(stock_monthly['close']) > 2: @@ -481,16 +481,16 @@ class AnalyzerSqlite: type = "monthly_종가_12월선_상향돌파" final_status += " " + type final_status_count += 1 - self.writeFile(type, CODE, NAME, top, stock_weekly, status) + self.writeFile(type, CODE, NAME, top, stock_monthly, status) - # RSI가 32 이하인 경우 (30이 이하로 떨어지는 것 미리 확인) + # RSI가 30 이하인 경우 if len(stock_monthly['close']) > 1: if stock_monthly['rsi'][0] is not None: if stock_monthly['rsi'][0] <= 30: type = "monthly_rsi_30이하" final_status += " " + type final_status_count += 1 - self.writeFile(type, CODE, NAME, top, stock_weekly, status) + self.writeFile(type, CODE, NAME, top, stock_monthly, status) # rsi가 rsis 아래에서 위로 올라올 때 if len(stock_monthly['close']) > 60: @@ -544,11 +544,11 @@ class AnalyzerSqlite: final_status_count += 1 self.writeFile(type, CODE, NAME, top, stock_weekly, status) - # RSI가 32 이하인 경우 (30이 이하로 떨어지는 것 미리 확인) + # RSI가 25 이하인 경우 if len(stock_monthly['close']) > 1: if stock_weekly['rsi'][0] is not None: - if stock_weekly['rsi'][0] <= 20: - type = "weekly_rsi_20이하" + if stock_weekly['rsi'][0] <= 25: + type = "weekly_rsi_25이하" final_status += " " + type final_status_count += 1 self.writeFile(type, CODE, NAME, top, stock_weekly, status) @@ -579,13 +579,13 @@ class AnalyzerSqlite: # 3) daily if len(stock_daily['volume']) > 5: - # RSI가 10 이하인 경우 (10이 이하로 떨어지는 것 미리 확인) + # RSI가 25 이하인 경우 if stock_daily['rsi'][0] is not None: - if stock_daily['rsi'][0] <= 10: - type = "daily_rsi_10이하" + if stock_daily['rsi'][0] <= 25: + type = "daily_rsi_25이하" final_status += " " + type final_status_count += 1 - self.writeFile(type, CODE, NAME, top, stock_weekly, status) + self.writeFile(type, CODE, NAME, top, stock_daily, status) # 2년 중 최대 거래량인 경우 size = len(stock_daily['volume']) @@ -654,7 +654,7 @@ class AnalyzerSqlite: type = "daily_weekly_monthly_rsi_10_20_30이하" final_status += " " + type final_status_count += 1 - self.writeFile(type, CODE, NAME, top, stock_weekly, status) + self.writeFile(type, CODE, NAME, top, stock_daily, status) if final_status_count > 0: type = "final"