init
This commit is contained in:
@@ -26,6 +26,8 @@ from stock.analysis.Envelope import Envelope
|
||||
from stock.analysis.MFI import MFI
|
||||
from stock.analysis.MovingAverage import MovingAverage
|
||||
|
||||
from stock.util.TelegramBot import TelegramBot
|
||||
|
||||
class AnalyzerSqlite:
|
||||
stochastic = None
|
||||
bolingerBand = None
|
||||
@@ -43,9 +45,11 @@ class AnalyzerSqlite:
|
||||
analyzedFileName = None
|
||||
|
||||
moving_avg = None
|
||||
bot = None
|
||||
|
||||
def __init__(self, stockFileName=None):
|
||||
self.common = Common()
|
||||
self.bot = TelegramBot()
|
||||
|
||||
self.stochastic = Stochastic()
|
||||
self.bolingerBand = BolingerBand()
|
||||
@@ -476,6 +480,7 @@ class AnalyzerSqlite:
|
||||
|
||||
# 후보 찾기
|
||||
def findCandidates(self, outPath):
|
||||
result = []
|
||||
self.makeDirectory(outPath)
|
||||
|
||||
stockTableName = 'stock'
|
||||
@@ -586,6 +591,12 @@ class AnalyzerSqlite:
|
||||
dir_name = "daily_5_20"
|
||||
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'])
|
||||
self.bot.sendMsg(pStr)
|
||||
return
|
||||
|
||||
def get_moving_average(self, stock):
|
||||
|
||||
Reference in New Issue
Block a user