init
This commit is contained in:
12
HTS_etf.py
12
HTS_etf.py
@@ -80,11 +80,13 @@ class HTS_etf (HTS):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def getCount(self, stock_code, price):
|
def getCount(self, stock_code, price, data=None):
|
||||||
|
MAX_BUY_PRICE = 50000
|
||||||
if stock_code == "252670" or stock_code == "122630":
|
if stock_code == "252670" or stock_code == "122630":
|
||||||
MAX_BUY_PRICE = 100000
|
if data['slow_k'][-2] < data['slow_k'][-1] < 40:
|
||||||
else:
|
MAX_BUY_PRICE = 100000
|
||||||
MAX_BUY_PRICE = 50000
|
if data['slow_k'][-2] < data['slow_k'][-1] < 20:
|
||||||
|
MAX_BUY_PRICE = 200000
|
||||||
|
|
||||||
count = int(MAX_BUY_PRICE / price)
|
count = int(MAX_BUY_PRICE / price)
|
||||||
return count
|
return count
|
||||||
@@ -139,7 +141,7 @@ class HTS_etf (HTS):
|
|||||||
if bs_buy_price > 0:
|
if bs_buy_price > 0:
|
||||||
|
|
||||||
if not self.orderChecker.exist(today, "A" + stock['stock_code'], hours=9):
|
if not self.orderChecker.exist(today, "A" + stock['stock_code'], hours=9):
|
||||||
buy_count = self.getCount(stock['stock_code'], bs_buy_price)
|
buy_count = self.getCount(stock['stock_code'], bs_buy_price, data)
|
||||||
|
|
||||||
if buy_count > 0:
|
if buy_count > 0:
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class HTS_Stocks (HTS):
|
|||||||
self.orderChecker = OrderChecker(self.RESOURCE_PATH, "STOCK")
|
self.orderChecker = OrderChecker(self.RESOURCE_PATH, "STOCK")
|
||||||
|
|
||||||
self.analyzed_day = 120
|
self.analyzed_day = 120
|
||||||
self.MAX_BUY_PRICE = 100000
|
self.MAX_BUY_PRICE = 50000
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -150,6 +150,8 @@ class HTS_Stocks (HTS):
|
|||||||
bs_buy_price = bsLine['buy'][last_index]
|
bs_buy_price = bsLine['buy'][last_index]
|
||||||
bs_buy_weight = bsLine['buy_weight'][last_index]
|
bs_buy_weight = bsLine['buy_weight'][last_index]
|
||||||
buy_count = int(self.MAX_BUY_PRICE / bs_buy_price)
|
buy_count = int(self.MAX_BUY_PRICE / bs_buy_price)
|
||||||
|
if self.MAX_BUY_PRICE <= bs_buy_price < 2 * self.MAX_BUY_PRICE:
|
||||||
|
buy_count = int(2 * self.MAX_BUY_PRICE / bs_buy_price)
|
||||||
|
|
||||||
if buy_count > 0:
|
if buy_count > 0:
|
||||||
# 매수를 주문한다.
|
# 매수를 주문한다.
|
||||||
|
|||||||
Reference in New Issue
Block a user