This commit is contained in:
dsyoon
2023-02-20 09:40:34 +09:00
parent 34dc901c1a
commit 6ff98b55d0
2 changed files with 12 additions and 5 deletions

View File

@@ -138,6 +138,9 @@ class HTS_etf (HTS):
if items is not None and len(items)>0:
slow_k_month = items[0]
if slow_k_week is None: slow_k_week = -1
if slow_k_month is None: slow_k_month = -1
return slow_k_week, slow_k_month
def buyRealTime(self, today, stocks, analyzed_day=1000):
@@ -157,12 +160,14 @@ class HTS_etf (HTS):
# 매도를 체크한다.
self.sellStocks()
for stock in stocks:
for idx, stock in enumerate(stocks):
time.sleep(0.1)
print(idx, stock['stock_code'], stock['stock_name'])
slow_k_week, slow_k_month = self.getSlowK(stock['stock_code'])
if slow_k_week < 0 or 20 < slow_k_week or slow_k_month < 0 or 20 < slow_k_month:
if slow_k_week < 0 or 50 < slow_k_week or slow_k_month < 0 or 50 < slow_k_month:
continue
try:

View File

@@ -126,6 +126,9 @@ class HTS_Stocks (HTS):
if items is not None and len(items)>0:
slow_k_month = items[0]
if slow_k_week is None: slow_k_week = -1
if slow_k_month is None: slow_k_month = -1
return slow_k_week, slow_k_month
def getMaxPrice(self, code, valid_company):
@@ -145,7 +148,6 @@ class HTS_Stocks (HTS):
def buyRealTime(self, today, n = 200):
a,b = self.getSlowK("001430")
print ("START...")
THIS_TIME = datetime.now()
@@ -171,10 +173,10 @@ class HTS_Stocks (HTS):
re.search("\d.*?호", stock_name) is not None) and
stock_code not in valid_company):
continue
print(idx, stock_code, stock_name, ", CODE: ", stock_code, ", NAME: ", stock_name)
print(idx, stock_code, stock_name)
slow_k_week, slow_k_month = self.getSlowK(stock_code)
if slow_k_week < 0 or 20 < slow_k_week or slow_k_month < 0 or 20 < slow_k_month:
if slow_k_week < 0 or 50 < slow_k_week or slow_k_month < 0 or 50 < slow_k_month:
continue
stock = self.stockStatus.fetchLastData(self.cursor_stock, stock_code, n)