init
This commit is contained in:
@@ -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,12 @@ 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'])
|
pStr += " <{}> {} {} ({:.2f})\n".format(item['type'], item['ticker_code'], item['ticker_name'], item['close'])
|
||||||
i += 1
|
i += 1
|
||||||
if i==100:
|
if i==100:
|
||||||
@@ -623,6 +626,28 @@ class AnalyzerSqlite:
|
|||||||
pStr = ''
|
pStr = ''
|
||||||
if i>0:
|
if i>0:
|
||||||
self.bot.sendMsg(pStr)
|
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'])
|
||||||
|
i += 1
|
||||||
|
if i == 100:
|
||||||
|
i = 0
|
||||||
|
self.bot.sendMsg(pStr)
|
||||||
|
pStr = ''
|
||||||
|
if i > 0:
|
||||||
|
self.bot.sendMsg(pStr)
|
||||||
return
|
return
|
||||||
|
|
||||||
def get_moving_average(self, stock):
|
def get_moving_average(self, stock):
|
||||||
|
|||||||
Reference in New Issue
Block a user