init
This commit is contained in:
@@ -11,7 +11,7 @@ from stock.crawler.MetaCrawler import MetaCrawler
|
||||
from stock.crawler.StockCrawler import StockCrawler
|
||||
from stock.analysis.AnalyzerSqlite import AnalyzerSqlite
|
||||
from stock.analysis.StockStatus import StockStatus
|
||||
from stock.util.SlackBot import SlackBot
|
||||
from stock.util.TelegramBot import TelegramBot
|
||||
|
||||
|
||||
today = datetime.now().strftime("%Y-%m-%d")
|
||||
@@ -30,11 +30,11 @@ stockFileName = os.path.join(RESOURCE_PATH, 'stock.db')
|
||||
|
||||
week = datetime.today().weekday()
|
||||
|
||||
slackBot = SlackBot()
|
||||
bot = TelegramBot()
|
||||
|
||||
if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
|
||||
slackBot.sendMsg("1. start to crawl...")
|
||||
bot.sendMsg("1. start to crawl...")
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
try:
|
||||
print("\n[증시자금동향 (신용잔고, 펀드자금 잔고)]")
|
||||
metaCrawler.crawl_money_trend(stockFileName)
|
||||
slackBot.sendMsg("2. done meta data...")
|
||||
bot.sendMsg("2. done meta data...")
|
||||
break
|
||||
except:
|
||||
ERROR_COUNT += 1
|
||||
@@ -78,7 +78,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
try:
|
||||
print("\n[국내 시장금리]")
|
||||
metaCrawler.crawl_interest_rates(stockFileName)
|
||||
slackBot.sendMsg("3. done interest rates...")
|
||||
bot.sendMsg("3. done interest rates...")
|
||||
break
|
||||
except:
|
||||
ERROR_COUNT += 1
|
||||
@@ -93,7 +93,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
try:
|
||||
print("\n[투자자별 매매동향(Trading_Trend)]")
|
||||
metaCrawler.crawl_trading_trend(stockFileName)
|
||||
slackBot.sendMsg("4. done trade trend...")
|
||||
bot.sendMsg("4. done trade trend...")
|
||||
break
|
||||
except:
|
||||
ERROR_COUNT += 1
|
||||
@@ -108,7 +108,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
try:
|
||||
print("\n[환율 (USD, JPY, EUR, CNY, HKD, GBP, CAD, CHF, AUD, THB, INR, PHP, BRL, VND, RUB, TWD')]")
|
||||
metaCrawler.crawl_exchange(stockFileName)
|
||||
slackBot.sendMsg("5. done exchange data...")
|
||||
bot.sendMsg("5. done exchange data...")
|
||||
break
|
||||
except:
|
||||
ERROR_COUNT += 1
|
||||
@@ -123,7 +123,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
try:
|
||||
print("\n[원유 (WTI), 국제금, COPPER, NATURALGAS, CORN, SOYBEAN 등]")
|
||||
metaCrawler.crawl_meterials(stockFileName)
|
||||
slackBot.sendMsg("6. done additional data...")
|
||||
bot.sendMsg("6. done additional data...")
|
||||
break
|
||||
except:
|
||||
ERROR_COUNT += 1
|
||||
@@ -140,19 +140,19 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
|
||||
print("\n[국내 ETF 수집]")
|
||||
stockCrawler.crawl_etf_stocks(stockFileName)
|
||||
slackBot.sendMsg("7. done etf stocks...")
|
||||
bot.sendMsg("7. done etf stocks...")
|
||||
|
||||
|
||||
|
||||
print("\n[국내 종목 수집]")
|
||||
stockCrawler.crawl_stocks(stockFileName)
|
||||
slackBot.sendMsg("8. done stocks...")
|
||||
bot.sendMsg("8. done stocks...")
|
||||
|
||||
|
||||
|
||||
print("\n[US 종목 수집]")
|
||||
stockCrawler.crawl_special_stocks(stockFileName)
|
||||
slackBot.sendMsg("9. done US stocks...")
|
||||
bot.sendMsg("9. done US stocks...")
|
||||
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
analyzerSqlite.analyzeDaily()
|
||||
analyzerSqlite.analyzeGrouping("weekly")
|
||||
analyzerSqlite.analyzeGrouping("monthly")
|
||||
slackBot.sendMsg("10. analyze...")
|
||||
bot.sendMsg("10. analyze...")
|
||||
|
||||
|
||||
|
||||
@@ -186,11 +186,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
os.mkdir(outPath)
|
||||
|
||||
analyzerSqlite.findCandidates(outPath)
|
||||
slackBot.sendMsg("11. done decision...")
|
||||
|
||||
|
||||
|
||||
|
||||
bot.sendMsg("11. done decision...")
|
||||
|
||||
|
||||
print("time : %6.2f 초", (time.time() - start))
|
||||
|
||||
Reference in New Issue
Block a user