This commit is contained in:
dsyoon
2024-11-16 15:07:39 +09:00
parent 3ffc86e33b
commit 8313c67d11

View File

@@ -482,7 +482,10 @@ class AnalyzerSqlite:
# 후보 찾기 # 후보 찾기
def findCandidates(self, outPath): def findCandidates(self, outPath):
result = [] result_3_5 = []
result_5_20 = []
result_ichimok = []
self.makeDirectory(outPath) self.makeDirectory(outPath)
stockTableName = 'stock' stockTableName = 'stock'
@@ -593,7 +596,7 @@ class AnalyzerSqlite:
dir_name = "daily_5_20" dir_name = "daily_5_20"
log = str(count) + "_" + dir_name + "_" log = str(count) + "_" + dir_name + "_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log) self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
result.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': '5~20'}) result_5_20.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': '5~20'})
check = self.common.buy_stock_daily_3_5(stock_daily) check = self.common.buy_stock_daily_3_5(stock_daily)
if check: if check:
@@ -601,7 +604,7 @@ class AnalyzerSqlite:
dir_name = "daily_3_5" dir_name = "daily_3_5"
log = str(count) + "_" + dir_name + "_" log = str(count) + "_" + dir_name + "_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log) self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
result.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': '3~5'}) result_3_5.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': '3~5'})
check = self.common.buy_stock_ichimok(stock_daily) check = self.common.buy_stock_ichimok(stock_daily)
if check: if check:
@@ -609,12 +612,34 @@ class AnalyzerSqlite:
dir_name = "daily_ichimok" dir_name = "daily_ichimok"
log = str(count) + "_" + dir_name + "_" log = str(count) + "_" + dir_name + "_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log) self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
result.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': 'ichimok'}) result_ichimok.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0], 'type': 'ichimok'})
pStr = '[Stock Analysis]\n' pStr = '[Stock Analysis]\n'
i = 0 i = 0
for item in result: for item in result_3_5:
pStr += " <{}> {} {} ({:.2f})\n".format(item['type'], item['ticker_code'], item['ticker_name'], item['close'])
i += 1
if i==100:
i = 0
self.bot.sendMsg(pStr)
pStr = ''
if i>0:
self.bot.sendMsg(pStr)
i = 0
for item in result_5_20:
pStr += " <{}> {} {} ({:.2f})\n".format(item['type'], item['ticker_code'], item['ticker_name'], item['close'])
i += 1
if i == 100:
i = 0
self.bot.sendMsg(pStr)
pStr = ''
if i > 0:
self.bot.sendMsg(pStr)
i = 0
for item in result_ichimok:
pStr += " <{}> {} {} ({:.2f})\n".format(item['type'], item['ticker_code'], item['ticker_name'], item['close']) pStr += " <{}> {} {} ({:.2f})\n".format(item['type'], item['ticker_code'], item['ticker_name'], item['close'])
i += 1 i += 1
if i == 100: if i == 100: