init
This commit is contained in:
@@ -138,6 +138,9 @@ class HTS_etf (HTS):
|
|||||||
if items is not None and len(items)>0:
|
if items is not None and len(items)>0:
|
||||||
slow_k_month = 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
|
return slow_k_week, slow_k_month
|
||||||
|
|
||||||
def buyRealTime(self, today, stocks, analyzed_day=1000):
|
def buyRealTime(self, today, stocks, analyzed_day=1000):
|
||||||
@@ -157,12 +160,14 @@ class HTS_etf (HTS):
|
|||||||
# 매도를 체크한다.
|
# 매도를 체크한다.
|
||||||
self.sellStocks()
|
self.sellStocks()
|
||||||
|
|
||||||
for stock in stocks:
|
for idx, stock in enumerate(stocks):
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
print(idx, stock['stock_code'], stock['stock_name'])
|
||||||
|
|
||||||
slow_k_week, slow_k_month = self.getSlowK(stock['stock_code'])
|
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
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ class HTS_Stocks (HTS):
|
|||||||
if items is not None and len(items)>0:
|
if items is not None and len(items)>0:
|
||||||
slow_k_month = 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
|
return slow_k_week, slow_k_month
|
||||||
|
|
||||||
def getMaxPrice(self, code, valid_company):
|
def getMaxPrice(self, code, valid_company):
|
||||||
@@ -145,7 +148,6 @@ class HTS_Stocks (HTS):
|
|||||||
|
|
||||||
def buyRealTime(self, today, n = 200):
|
def buyRealTime(self, today, n = 200):
|
||||||
|
|
||||||
a,b = self.getSlowK("001430")
|
|
||||||
print ("START...")
|
print ("START...")
|
||||||
THIS_TIME = datetime.now()
|
THIS_TIME = datetime.now()
|
||||||
|
|
||||||
@@ -171,10 +173,10 @@ class HTS_Stocks (HTS):
|
|||||||
re.search("\d.*?호", stock_name) is not None) and
|
re.search("\d.*?호", stock_name) is not None) and
|
||||||
stock_code not in valid_company):
|
stock_code not in valid_company):
|
||||||
continue
|
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)
|
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
|
continue
|
||||||
|
|
||||||
stock = self.stockStatus.fetchLastData(self.cursor_stock, stock_code, n)
|
stock = self.stockStatus.fetchLastData(self.cursor_stock, stock_code, n)
|
||||||
|
|||||||
Reference in New Issue
Block a user