init
This commit is contained in:
@@ -460,7 +460,7 @@ class Analyzer:
|
||||
|
||||
# 최근 20일간 +-종목 개수 체크
|
||||
inde_check = []
|
||||
for check_index in range(20):
|
||||
for check_index in range(365):
|
||||
inde_check.append([0,0])
|
||||
|
||||
while result != None:
|
||||
@@ -551,7 +551,7 @@ class Analyzer:
|
||||
|
||||
self.writeFile(fig, state, isbuy, buy_price, bolingerband_score, stochastic_score, positionalEnergy, item_name, item_code)
|
||||
|
||||
for check_index in range(20):
|
||||
for check_index in range(365):
|
||||
if len(STOCK) > check_index and STOCK[last_index-check_index]['open'] < STOCK[last_index-check_index]['close']:
|
||||
inde_check[check_index][0] += 1
|
||||
else:
|
||||
@@ -561,10 +561,11 @@ class Analyzer:
|
||||
cursor.execute('SELECT CODE, NAME, PRICE, STOCHASTIC, BOLINGERBAND FROM ' + self.tableName + ' WHERE rowid=?', (rowid,))
|
||||
result = cursor.fetchone()
|
||||
|
||||
print()
|
||||
for check_index in range(20):
|
||||
print ("%d일전 + %d - %d %4.2f" % (check_index, inde_check[check_index][0], inde_check[check_index][1], inde_check[check_index][0]*100/(inde_check[check_index][0]+inde_check[check_index][1])))
|
||||
print()
|
||||
outFp = open("inout.cvs", mode='w')
|
||||
for check_index in range(365):
|
||||
idx = 365 - check_index - 1
|
||||
outFp.write("%d,%d,%d %4.2f\n" % (idx, inde_check[idx][0], inde_check[idx][1], inde_check[idx][0]*100/(inde_check[idx][0]+inde_check[idx][1])))
|
||||
outFp.close()
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user