|
@@ -21,7 +21,7 @@ R_list = [] # ROE
|
21
|
21
|
O_list = [] # 其他
|
22
|
22
|
|
23
|
23
|
|
24
|
|
-def predict_today(file, day, model='10_18d', log=True):
|
|
24
|
+def predict_today(file, day, model='10_18d', log=True, x=29, y=1):
|
25
|
25
|
industry_list = get_hot_industry(day)
|
26
|
26
|
|
27
|
27
|
lines = []
|
|
@@ -36,10 +36,10 @@ def predict_today(file, day, model='10_18d', log=True):
|
36
|
36
|
|
37
|
37
|
for line in lines:
|
38
|
38
|
train_x = np.array([line[:size - 1]])
|
39
|
|
- train_x_tmp = train_x[:,:28*16]
|
40
|
|
- train_x_a = train_x_tmp.reshape(train_x.shape[0], 28, 16, 1)
|
|
39
|
+ train_x_tmp = train_x[:,:x*y]
|
|
40
|
+ train_x_a = train_x_tmp.reshape(train_x.shape[0], x, y, 1)
|
41
|
41
|
# train_x_b = train_x_tmp.reshape(train_x.shape[0], 18, 24)
|
42
|
|
- train_x_c = train_x[:,28*16:]
|
|
42
|
+ train_x_c = train_x[:,x*y:]
|
43
|
43
|
|
44
|
44
|
result = model.predict([train_x_c, train_x_a, ])
|
45
|
45
|
# print(result, line[-1])
|
|
@@ -94,14 +94,18 @@ def predict_today(file, day, model='10_18d', log=True):
|
94
|
94
|
print(R_list[:])
|
95
|
95
|
|
96
|
96
|
|
|
97
|
+import datetime
|
97
|
98
|
if __name__ == '__main__':
|
|
99
|
+ today = datetime.datetime.now()
|
|
100
|
+ today = today
|
|
101
|
+ today = today.strftime('%Y%m%d')
|
98
|
102
|
# predict(file_path='D:\\data\\quantization\\stock6_5_test.log', model_path='5d_dnn_seq.h5')
|
99
|
103
|
# predict(file_path='D:\\data\\quantization\\stock6_test.log', model_path='15m_dnn_seq.h5')
|
100
|
104
|
# multi_predict()
|
101
|
105
|
# 策略B
|
102
|
106
|
# predict_today("D:\\data\\quantization\\stock505_28d_20200416.log", 20200416, model='505_28d_mix_5D_ma5_s_seq.h5', log=True)
|
103
|
|
- predict_today("D:\\data\\quantization\\stock517_28d_20200429.log", 20200429, model='517_28d_mix_3D_ma5_s_seq.h5', log=True)
|
104
|
|
- # predict_today("D:\\data\\quantization\\stock538_28d_20200205.log", 20200205, model='539_28d_mix_5D_ma5_s_seq.h5', log=True)
|
|
107
|
+ # predict_today("D:\\data\\quantization\\stock517_28d_" + str(today) + ".log", int(today), model='517_28d_mix_3D_ma5_s_seq.h5', log=True, x=28, y=16)
|
|
108
|
+ predict_today("D:\\data\\quantization\\stock538_28d_" + str(today) + ".log", int(today), model='539_28d_mix_5D_ma5_s_seq.h5', log=True, x=28, y=17)
|
105
|
109
|
|
106
|
110
|
# join_two_day(20200305, 20200305)
|
107
|
111
|
# check_everyday(20200311, 20200312)
|