From 2b596544e71b67f3de6b6d343bda624f78d46a00 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Thu, 24 Oct 2024 23:56:50 +0900 Subject: [PATCH] init --- AnalyzerSqlite.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AnalyzerSqlite.py b/AnalyzerSqlite.py index f969c97..f9b427f 100644 --- a/AnalyzerSqlite.py +++ b/AnalyzerSqlite.py @@ -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):