init
This commit is contained in:
@@ -475,6 +475,7 @@ class AnalyzerSqlite:
|
||||
self.makeDir("daily_final_candidate")
|
||||
self.makeDir("daily_bol_candidate")
|
||||
self.makeDir('daily_5_20')
|
||||
self.makeDir('daily_20_60')
|
||||
|
||||
return
|
||||
|
||||
@@ -593,6 +594,14 @@ class AnalyzerSqlite:
|
||||
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
|
||||
result.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0]})
|
||||
|
||||
check = self.common.buy_stock_dail5_20_60(stock_daily)
|
||||
if check:
|
||||
count += 1
|
||||
dir_name = "daily_20_60"
|
||||
log = str(count) + "_" + dir_name + "_"
|
||||
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
|
||||
result.append({'ticker_code': CODE, 'ticker_name': NAME,'close': stock_daily['close'][0]})
|
||||
|
||||
pStr = '[Stock Analysis]\n'
|
||||
for item in result:
|
||||
pStr += " {} {} ({:.2f})\n".format(item['ticker_code'], item['ticker_name'], item['close'])
|
||||
|
||||
@@ -711,13 +711,16 @@ class Common:
|
||||
|
||||
return -1
|
||||
|
||||
def buy_stock_dail5_5_20(self, stock_daily):
|
||||
|
||||
if stock_daily['avg5'][1] < stock_daily['avg20'][1] and stock_daily['avg20'][0] < stock_daily['avg5'][0]:
|
||||
if stock_daily['avg20'][0] < stock_daily['avg5'][0] < stock_daily['avg40'][0]:
|
||||
return True
|
||||
def buy_stock_daily_5_20(self, stock_daily):
|
||||
|
||||
if stock_daily['avg5'][1] < stock_daily['avg20'][1] and stock_daily['avg20'][0] < stock_daily['avg5'][0]:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def buy_stock_daily_20_60(self, stock_daily):
|
||||
|
||||
if stock_daily['avg20'][1] < stock_daily['avg60'][1] and stock_daily['avg60'][0] < stock_daily['avg20'][0]:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user