This commit is contained in:
dsyoon
2021-09-11 00:09:16 +09:00
parent f598aeaff4
commit 42670252fa

View File

@@ -455,10 +455,10 @@ class Analyzer:
conn = sqlite3.connect(self.inFileName)
cursor = conn.cursor()
rowid = 1
cursor.execute('SELECT * FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
cursor.execute('SELECT CODE, NAME, PRICE, STOCHASTIC, BOLINGERBAND FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
result = cursor.fetchone()
# 최근 10일간 +-종목 개수 체크
# 최근 20일간 +-종목 개수 체크
inde_check = []
for check_index in range(20):
inde_check.append([0,0])
@@ -468,9 +468,13 @@ class Analyzer:
item_name = result[1]
print("#html", rowid, item_name)
if rowid == 1821 or item_name == "롯리츠":
print(1)
# 부실 기업은 매수하지 않고 그냥 넘긴다.
# kospi 지수와 kosdak 지수도 그냥 넘긴다.
if ((item_code in self.fnguide and not self.fnguide[item_code]) or (item_code == "KOSPI" or item_code == "KOSDAK") or result[3] == ''):
#if ((item_code in self.fnguide and not self.fnguide[item_code]) or (item_code == "KOSPI" or item_code == "KOSDAK") or result[3] == ''):
if ((item_code in self.fnguide and not self.fnguide[item_code]) or (item_code == "KOSPI" or item_code == "KOSDAK")):
rowid += 1
# 다음 종목을 가져옴
cursor.execute('SELECT CODE, NAME, PRICE, STOCHASTIC, BOLINGERBAND FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
@@ -506,7 +510,6 @@ class Analyzer:
# 위치 에너지
positionalEnergy = self.getPositionalEnergy(STOCK, last_index)
if stochastic_score < 30 or bolingerband_score < 0.3:
if STOCK[last_index]['volume'] > 100000 and STOCK[last_index]['close'] > 1000:
# 종목 상태 체크 분석
state, buy_price = self.analyzeFinalScore(last_index, STOCK, STOCHASTIC)
@@ -556,7 +559,7 @@ class Analyzer:
inde_check[check_index][1] += 1
rowid += 1
cursor.execute('SELECT * FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
cursor.execute('SELECT CODE, NAME, PRICE, STOCHASTIC, BOLINGERBAND FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
result = cursor.fetchone()
print()