Change something for the strategy
This commit is contained in:
+14
@@ -91,6 +91,7 @@ class ChanLun():
|
||||
klc_list = self.get_klc_list(dataframe)
|
||||
bi_list= self.cal_bi_list(klc_list)
|
||||
def get_klc_state_list(self, dataframe):
|
||||
klu_list = self.get_klu_list(dataframe)
|
||||
klc_list = self.get_klc_list(dataframe)
|
||||
bi_list= self.cal_bi_list(klc_list)
|
||||
state_list = []
|
||||
@@ -116,10 +117,23 @@ class ChanLun():
|
||||
state_list.append("00")
|
||||
else:
|
||||
state_list.append("00")
|
||||
klu = klu_list[index]
|
||||
if klu.volume_ratio > 4.0:
|
||||
if klu.close < klu.open:
|
||||
state_list[-1] = "99"
|
||||
print(klu.time, klu.volume_ratio, "99")
|
||||
else:
|
||||
state_list[-1] = "-99"
|
||||
print(klu.time, klu.volume_ratio, "-99")
|
||||
else:
|
||||
for index in range(0, len(dataframe)):
|
||||
state_list.append("00")
|
||||
return state_list
|
||||
def get_all_state(self, df_list):
|
||||
state_list = []
|
||||
for df in df_list:
|
||||
state_list.append(self.get_klc_state_list(df))
|
||||
return state_list
|
||||
def print_data(self, dataframe):
|
||||
klc_list = self.get_klc_list(dataframe)
|
||||
bi_list = self.cal_bi_list(klc_list)
|
||||
|
||||
Reference in New Issue
Block a user