init
This commit is contained in:
@@ -42,7 +42,7 @@ class BuySellChecker_122630 (BuySellChecker):
|
||||
def checkTransaction(self, stock_code, data, INFO, isRealTime=True):
|
||||
sell, weight = -1, -1
|
||||
|
||||
if data['close'][i] < INFO['LOW_PRICE'] < data['close'][i-1]:
|
||||
if data['close'][i] < INFO['LIMIT_PRICE'] < data['close'][i-1]:
|
||||
sell = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class BuySellChecker_251340 (BuySellChecker):
|
||||
def getSellPriceAndWeight(self, stock_code, i, data, INFO):
|
||||
sell, weight = -1, -1
|
||||
|
||||
if data['close'][i] < INFO['LOW_PRICE'] < data['close'][i-1]:
|
||||
if data['close'][i] < INFO['LIMIT_PRICE'] < data['close'][i-1]:
|
||||
sell = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
|
||||
@@ -11,42 +11,47 @@ class BuySellChecker_252670 (BuySellChecker):
|
||||
|
||||
C_MIN_AVG_5_200 = max(data['disparity_avg5'][i], data['disparity_avg20'][i], data['disparity_avg60'][i], data['disparity_avg200'][i]) - min(data['disparity_avg5'][i], data['disparity_avg20'][i], data['disparity_avg60'][i], data['disparity_avg200'][i])
|
||||
C_MIN_AVG_5_60 = max(data['disparity_avg5'][i], data['disparity_avg20'][i], data['disparity_avg60'][i]) - min(data['disparity_avg5'][i], data['disparity_avg20'][i], data['disparity_avg60'][i])
|
||||
C_DIFF_AVG_200_5 = abs(data['disparity_avg200'][i] - data['disparity_avg5'][i])
|
||||
|
||||
MIN_AVG_5_200 = 0.002
|
||||
MIN_AVG_5_60 = 0.002
|
||||
DIFF_200_5 = 0.001
|
||||
if 0.004 < C_MIN_AVG_5_60 < 0.005 and 0.007 < C_MIN_AVG_5_200 < 0.008 and 0.007 < C_DIFF_AVG_200_5 < 0.008:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.023 < C_MIN_AVG_5_60 < 0.024 and 0.026 < C_MIN_AVG_5_200 < 0.027 and 0.026 < C_DIFF_AVG_200_5 < 0.027:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.013 < C_MIN_AVG_5_60 < 0.014 and 0.013 < C_MIN_AVG_5_200 < 0.014 and 0.013 < C_DIFF_AVG_200_5 < 0.014:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.004 < C_MIN_AVG_5_60 < 0.005 and 0.005 < C_MIN_AVG_5_200 < 0.006 and 0.0008 < C_DIFF_AVG_200_5 < 0.001:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.001 < C_MIN_AVG_5_60 < 0.0015 and 0.0055 < C_MIN_AVG_5_200 < 0.006 and 0.0055 < C_DIFF_AVG_200_5 < 0.006:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.001 < C_MIN_AVG_5_60 < 0.0015 and 0.0015 < C_MIN_AVG_5_200 < 0.002 and 0.0015 < C_DIFF_AVG_200_5 < 0.002:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.009 < C_MIN_AVG_5_60 < 0.0095 and 0.01 < C_MIN_AVG_5_200 < 0.012 and 0.01 < C_DIFF_AVG_200_5 < 0.012:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.002 < C_MIN_AVG_5_60 < 0.0023 and 0.0062 < C_MIN_AVG_5_200 < 0.0068 and 0.0062 < C_DIFF_AVG_200_5 < 0.0068:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if 0.008 < C_MIN_AVG_5_60 < 0.0085 and 0.008 < C_MIN_AVG_5_200 < 0.0085 and 0.0075 < C_DIFF_AVG_200_5 < 0.008:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
if (abs(data['disparity_avg200'][i] - data['disparity_avg5'][i]) < DIFF_200_5 and C_MIN_AVG_5_200 < MIN_AVG_5_200 and C_MIN_AVG_5_60 < MIN_AVG_5_60):
|
||||
if data['avg200'][i] < data['avg5'][i]:
|
||||
if 180 < i:
|
||||
valid = True
|
||||
for c in range(5, 181):
|
||||
if data['avg200'][-c] < data['avg200'][-c]:
|
||||
valid = False
|
||||
break
|
||||
if valid:
|
||||
if max(data['volume'].tolist()[i-10:i]) < data['volume'][i]:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
if data['open'][i-2] < data['close'][i-2] and data['open'][i-1] < data['close'][i-1] and data['open'][i] < data['close'][i]:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
if data['macd'][i-1] < -1000:
|
||||
if -1000 < data['macd'][i]:
|
||||
buy = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
return buy, weight
|
||||
|
||||
def getSellPriceAndWeight(self, stock_code, i, data, INFO):
|
||||
sell, weight = -1, -1
|
||||
|
||||
if data['close'][i] < INFO['LOW_PRICE'] < data['close'][i-1]:
|
||||
if data['close'][i] < INFO['LIMIT_PRICE'] < data['close'][i-1]:
|
||||
sell = data['close'][i]
|
||||
weight = 1
|
||||
|
||||
if (650 < data['macd'][i]) and (0 < data['macdo'][i-1] and data['macdo'][i] <= 0):
|
||||
if (5 < data['macd'][i]) and (0 < data['macdo'][i-1] and data['macdo'][i] <= 0):
|
||||
#if data['macds'][i-1] < data['macd'][i-1] and data['macd'][i] < data['macds'][i]:
|
||||
weight = 1
|
||||
sell = data['close'][i]
|
||||
|
||||
Reference in New Issue
Block a user