지지 후 돌파 추가
This commit is contained in:
@@ -291,19 +291,31 @@ class Analyzer:
|
||||
# 거래량이 100만 이상이고, 종가가 1천원 이상인지 체크 (https://happpy-rich.tistory.com/94)
|
||||
|
||||
# 5-20
|
||||
days20_line_buying1_status = self.common.check_days20_line_buying1(STOCK, i)
|
||||
days20_line_buying1_status = self.common.check_days5_20_line_buying(STOCK, i)
|
||||
if days20_line_buying1_status != "":
|
||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||
status += days20_line_buying1_status
|
||||
|
||||
# 5-60
|
||||
days60_line_buying1_status = self.common.check_days60_line_buying1(STOCK, i)
|
||||
days60_line_buying1_status = self.common.check_days5_60_line_buying(STOCK, i)
|
||||
if days60_line_buying1_status != "":
|
||||
# if STOCHASTIC[i]['slow_k'] < 40:
|
||||
status += days60_line_buying1_status
|
||||
|
||||
# 5-120
|
||||
days120_line_buying1_status = self.common.check_days5_120_line_buying(STOCK, i)
|
||||
if days120_line_buying1_status != "":
|
||||
# if STOCHASTIC[i]['slow_k'] < 40:
|
||||
status += days120_line_buying1_status
|
||||
|
||||
# 5-240
|
||||
days240_line_buying1_status = self.common.check_days5_240_line_buying(STOCK, i)
|
||||
if days240_line_buying1_status != "":
|
||||
# if STOCHASTIC[i]['slow_k'] < 40:
|
||||
status += days240_line_buying1_status
|
||||
|
||||
# 20-60
|
||||
days60_line_buying2_status = self.common.check_days60_line_buying2(STOCK, i)
|
||||
days60_line_buying2_status = self.common.check_days20_60_line_buying(STOCK, i)
|
||||
if days60_line_buying2_status != "":
|
||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||
status += days60_line_buying2_status
|
||||
@@ -357,10 +369,11 @@ class Analyzer:
|
||||
while result != None:
|
||||
item_code = result[0]
|
||||
item_name = result[1]
|
||||
print("#html", rowid, item_name)
|
||||
|
||||
# 부실 기업은 매수하지 않고 그냥 넘긴다.
|
||||
# kospi 지수와 kosdak 지수도 그냥 넘긴다.
|
||||
if ((item_code in self.fnguide and not self.fnguide[item_code]) or (item_code == "KOSPI" or item_code == "KOSDAK")):
|
||||
if ((item_code in self.fnguide and not self.fnguide[item_code]) or (item_code == "KOSPI" or item_code == "KOSDAK") or result[3] == ''):
|
||||
rowid += 1
|
||||
# 다음 종목을 가져옴
|
||||
cursor.execute('SELECT * FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
|
||||
@@ -385,29 +398,29 @@ class Analyzer:
|
||||
ICHIMOKU = stock['ICHIMOKU']
|
||||
RSI = stock['RSI']
|
||||
|
||||
# 종목 상태 체크 분석
|
||||
state, buy_price = self.analyzeFinalScore(last_index, STOCK, MACD, STOCHASTIC, ICHIMOKU, RSI)
|
||||
|
||||
stochastic_score = STOCHASTIC[last_index]['slow_k']
|
||||
macd_score = MACD[last_index]['macd']
|
||||
rsi_score = RSI[last_index]['rsi']
|
||||
ichimoku_score = ICHIMOKU[last_index]['ichimoku_buy']
|
||||
if stochastic_score < 50:
|
||||
macd_score = MACD[last_index]['macd']
|
||||
rsi_score = RSI[last_index]['rsi']
|
||||
ichimoku_score = ICHIMOKU[last_index]['ichimoku_buy']
|
||||
|
||||
if state != "":
|
||||
fig = self.draw(stock)
|
||||
title = "%s (%s), %s, buy_price (%d), stochastic(%.3f), rsi(%.3f), macd(%.3f), ichimoku(%d) 차트" % (item_name, item_code, state, buy_price, stochastic_score, rsi_score, macd_score, ichimoku_score)
|
||||
fig['layout'].update(title=title)
|
||||
fileName = "%s/%s__%.3f__%.3f__%s_%s.html" % (outPath, state, stochastic_score, rsi_score, item_name.replace(" ", ""), item_code)
|
||||
po.write_html(fig, file=fileName, auto_open=False)
|
||||
else:
|
||||
if (RSI[last_index]['rsi_buy'] == 1) and STOCK[last_index]['volume'] > 1000000:
|
||||
# 종목 상태 체크 분석
|
||||
state, buy_price = self.analyzeFinalScore(last_index, STOCK, MACD, STOCHASTIC, ICHIMOKU, RSI)
|
||||
|
||||
if state != "":
|
||||
fig = self.draw(stock)
|
||||
title = "%s (%s) buy_price (%d), stochastic(%.3f), rsi(%.3f), macd(%.3f), ichimoku(%d) 차트"%(item_name, item_code, buy_price, stochastic_score, rsi_score, macd_score, ichimoku_score)
|
||||
title = "%s (%s), %s, buy_price (%d), stochastic(%.3f), rsi(%.3f), macd(%.3f), ichimoku(%d) 차트" % (item_name, item_code, state, buy_price, stochastic_score, rsi_score, macd_score, ichimoku_score)
|
||||
fig['layout'].update(title=title)
|
||||
fileName = "%s/%.3f__%.3f__%s_%s.html"%(tmp_path, stochastic_score, rsi_score, item_name.replace(" ", ""), item_code)
|
||||
fileName = "%s/%s__%.3f__%.3f__%s_%s.html" % (outPath, state, stochastic_score, rsi_score, item_name.replace(" ", ""), item_code)
|
||||
po.write_html(fig, file=fileName, auto_open=False)
|
||||
else:
|
||||
if (RSI[last_index]['rsi_buy'] == 1) and STOCK[last_index]['volume'] > 1000000:
|
||||
fig = self.draw(stock)
|
||||
title = "%s (%s) buy_price (%d), stochastic(%.3f), rsi(%.3f), macd(%.3f), ichimoku(%d) 차트"%(item_name, item_code, buy_price, stochastic_score, rsi_score, macd_score, ichimoku_score)
|
||||
fig['layout'].update(title=title)
|
||||
fileName = "%s/%.3f__%.3f__%s_%s.html"%(tmp_path, stochastic_score, rsi_score, item_name.replace(" ", ""), item_code)
|
||||
po.write_html(fig, file=fileName, auto_open=False)
|
||||
|
||||
print ("#html", rowid, stock['NAME'])
|
||||
rowid += 1
|
||||
cursor.execute('SELECT * FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
|
||||
result = cursor.fetchone()
|
||||
|
||||
Reference in New Issue
Block a user