This commit is contained in:
dsyoon
2023-10-12 23:14:19 +09:00
parent bef7240941
commit 65fbc7dc87
3 changed files with 11 additions and 11 deletions

View File

@@ -113,7 +113,7 @@ class HTS_etf(HTS):
return result
def buyRealTime(self, today, stock_code, analyzed_day=1000):
def buyRealTime(self, today, stock_code, stock_name, analyzed_day=1000):
MAX_PRICE = 10000
print("START...")
@@ -182,8 +182,8 @@ class HTS_etf(HTS):
print("TIMECHECK: %s, code: %s, buy: %d, sell: %d, avg5: %.2f, avg30: %.2f, open: %d, high: %d, low: %d, slow_k: %.2f" %
(str(THIS_TIME), stock_code, bs_buy_price, bs_sell_price, data["avg5"][0], data["avg30"][0], data["open"][0], data["high"][0], data["low"][0], data["slow_k"][0]))
if THIS_TIME.strftime("%M") == "00" or THIS_TIME.strftime("%M") == "05":
self.slackBot.post_live_to_slack(stock_code)
if int(THIS_TIME.strftime("%M")) % 10 == 0:
self.slackBot.post_live_to_slack(stock_code, stock_name)
time.sleep(60)
THIS_TIME = datetime.now()
@@ -210,7 +210,7 @@ if __name__ == "__main__":
hts.connect2DB("hts.db")
today_str = today.strftime('%Y%m%d')
hts.buyRealTime(today_str, stock_code, analyzed_day=1000)
hts.buyRealTime(today_str, stock_code, stock_name, analyzed_day=1000)
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
hts.insertStockData(today, stock_code, stock_name)