init
This commit is contained in:
@@ -154,8 +154,33 @@ class BuySellChecker:
|
||||
buy, weight, sell = -1, -1, -1
|
||||
return buy, weight
|
||||
|
||||
|
||||
|
||||
|
||||
def isYangbong(self, data, i):
|
||||
if data['close'][i] > data['open'][i]:
|
||||
return True
|
||||
if data['close'][i] == data['open'][i]:
|
||||
if data['low'][i] < data['close'][i] == data['high'][i]:
|
||||
return True
|
||||
if data['low'][i] < data['open'][i] == data['close'][i] < data['high'][i]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def isUmbong(self, data, i):
|
||||
if data['close'][i] < data['open'][i]:
|
||||
return True
|
||||
if data['close'][i] == data['open'][i]:
|
||||
if data['close'][i] == data['low'][i] < data['high'][i]:
|
||||
return True
|
||||
if data['low'][i] < data['open'][i] == data['close'][i] < data['high'][i]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
# 곱버스에 해당함
|
||||
def getBuyPriceAndWeight1(self, data, i):
|
||||
def getBuyPriceAndWeight_3000(self, data, i):
|
||||
buy, weight = -1, -1
|
||||
|
||||
START_TIME_INDEX = 0
|
||||
@@ -342,27 +367,7 @@ class BuySellChecker:
|
||||
return buy, weight
|
||||
|
||||
|
||||
def isYangbong(self, data, i):
|
||||
if data['close'][i] > data['open'][i]:
|
||||
return True
|
||||
if data['close'][i] == data['open'][i]:
|
||||
if data['low'][i] < data['close'][i] == data['high'][i]:
|
||||
return True
|
||||
if data['low'][i] < data['open'][i] == data['close'][i] < data['high'][i]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def isUmbong(self, data, i):
|
||||
if data['close'][i] < data['open'][i]:
|
||||
return True
|
||||
if data['close'][i] == data['open'][i]:
|
||||
if data['close'][i] == data['low'][i] < data['high'][i]:
|
||||
return True
|
||||
if data['low'][i] < data['open'][i] == data['close'][i] < data['high'][i]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def getSellPriceAndWeight1(self, data, i):
|
||||
def getSellPriceAndWeight_3000(self, data, i):
|
||||
sell, weight = -1, -1
|
||||
|
||||
START_TIME_INDEX = 0
|
||||
@@ -447,7 +452,7 @@ class BuySellChecker:
|
||||
|
||||
|
||||
# 레버리지에 해당함
|
||||
def getBuyPriceAndWeight2(self, data, i):
|
||||
def getBuyPriceAndWeight_15000(self, data, i):
|
||||
buy, weight = -1, -1
|
||||
|
||||
START_TIME_INDEX = 0
|
||||
@@ -618,7 +623,7 @@ class BuySellChecker:
|
||||
|
||||
return buy, weight
|
||||
|
||||
def getSellPriceAndWeight2(self, data, i):
|
||||
def getSellPriceAndWeight_15000(self, data, i):
|
||||
sell, weight = -1, -1
|
||||
|
||||
START_TIME_INDEX = 0
|
||||
@@ -795,11 +800,11 @@ class BuySellChecker:
|
||||
|
||||
for i in range(size):
|
||||
if stock_code == "252670":
|
||||
sell, weight = self.getSellPriceAndWeight1(data, i)
|
||||
buy, weight = self.getBuyPriceAndWeight1(data, i)
|
||||
sell, weight = self.getSellPriceAndWeight_3000(data, i)
|
||||
buy, weight = self.getBuyPriceAndWeight_3000(data, i)
|
||||
else:
|
||||
sell, weight = self.getSellPriceAndWeight2(data, i)
|
||||
buy, weight = self.getBuyPriceAndWeight2(data, i)
|
||||
sell, weight = self.getSellPriceAndWeight_15000(data, i)
|
||||
buy, weight = self.getBuyPriceAndWeight_15000(data, i)
|
||||
|
||||
bsLine['buy'][i] = buy
|
||||
bsLine['weight'][i] = weight
|
||||
|
||||
@@ -34,8 +34,8 @@ class HTS_122630 (HTS):
|
||||
|
||||
last_index = size - 1
|
||||
#buy, weight, sell = self.buySellChecker.getPriceAndWeight3(data, last_index)
|
||||
sell, weight = self.buySellChecker.getSellPriceAndWeight2(data, last_index)
|
||||
buy, weight = self.buySellChecker.getBuyPriceAndWeight2(data, last_index)
|
||||
sell, weight = self.buySellChecker.getSellPriceAndWeight_15000(data, last_index)
|
||||
buy, weight = self.buySellChecker.getBuyPriceAndWeight_15000(data, last_index)
|
||||
return buy, weight, sell
|
||||
|
||||
def getSellingPrice(self, final_price):
|
||||
|
||||
@@ -34,8 +34,8 @@ class HTS_252670 (HTS):
|
||||
|
||||
last_index = size - 1
|
||||
#buy, weight, sell = self.buySellChecker.getPriceAndWeight3(data, last_index)
|
||||
sell, weight = self.buySellChecker.getSellPriceAndWeight1(data, last_index)
|
||||
buy, weight = self.buySellChecker.getBuyPriceAndWeight1(data, last_index)
|
||||
sell, weight = self.buySellChecker.getSellPriceAndWeight_3000(data, last_index)
|
||||
buy, weight = self.buySellChecker.getBuyPriceAndWeight_3000(data, last_index)
|
||||
return buy, weight, sell
|
||||
|
||||
def getSellingPrice(self, final_price):
|
||||
|
||||
Reference in New Issue
Block a user