yufeng 2 years ago
parent
commit
a498e0c0c1

BIN
mix/5d_578N_dnn_seq.h5


+ 5 - 1
mix/mix_predict_by_day_324.py

@@ -80,7 +80,11 @@ def predict(file_path='', model_path='15min_dnn_seq', rows=18, cols=18):
80 80
         print(key, x0, x1, x2,x3, (down_num*1.5 + 2)/(up_num*1.2 + 2))
81 81
 
82 82
 
83
+import datetime
83 84
 if __name__ == '__main__':
85
+    today = datetime.datetime.now()
86
+    today = today
87
+    today =  today.strftime('%Y%m%d')
84 88
     # predict(file_path='D:\\data\\quantization\\stock6_5_test.log', model_path='5d_dnn_seq.h5')
85 89
     # predict(file_path='D:\\data\\quantization\\stock9_18_20200220.log', model_path='18d_dnn_seq.h5')
86 90
     # predict(file_path='D:\\data\\quantization\\stock9_18_2.log', model_path='18d_dnn_seq.h5')
@@ -90,7 +94,7 @@ if __name__ == '__main__':
90 94
 
91 95
     # predict(file_path='D:\\data\\quantization\\stock321_28d_5D_20200429.log', model_path='321_28d_mix_5D_ma5_s_seq_2', rows=28, cols=20)
92 96
 
93
-    predict(file_path='D:\\data\\quantization\\stock327_28d_20200429.log', model_path='327_28d_mix_5D_ma5_s_seq', rows=28, cols=20)
97
+    predict(file_path='D:\\data\\quantization\\stock327_28d_' + today + '.log', model_path='327_28d_mix_5D_ma5_s_seq', rows=28, cols=20)
94 98
 
95 99
 
96 100
 

+ 1 - 1
mix/mix_predict_by_day_578A.py

@@ -86,7 +86,7 @@ if __name__ == '__main__':
86 86
     # predict(file_path='D:\\data\\quantization\\stock196_18d_20200326.log', model_path='196_18d_mix_6D_ma5_s_seq')
87 87
 
88 88
 
89
-    # predict(file_path='D:\\data\\quantization\\stock578N_12d_train3.log', model_path='5d_578N_dnn_seq', rows=28, cols=20)
89
+    # predict(file_path='D:\\data\\quantization\\stock578N_12d_train4.log', model_path='5d_578N_dnn_seq', rows=28, cols=20)
90 90
 
91 91
     predict(file_path='D:\\data\\quantization\\stock578N_5d_' + today + '.log', model_path='5d_578N_dnn_seq', rows=28, cols=20)
92 92
     #

+ 10 - 6
mix/mix_predict_everyday_500.py

@@ -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)

+ 3 - 2
stock/dnn_train.py

@@ -144,11 +144,12 @@ def train(result_class=3, file_path="D:\\data\\quantization\\stock6.log", model_
144 144
 578K 用上日收盘价 39,101,46
145 145
 578L 仅ROC   41,101.6,43     41,2.036,29
146 146
 578M 仅macd  41,101.7,43     41,2.035,28
147
-578N 仅DMI                   42,2.079,33  随机45,1.82,20
147
+578N 仅DMI                   42,2.079,33|全数据50,2.67,72                 随机45,1.82,20
148 148
 578O 都去掉                  41,2.013,29
149
+580 去掉Low,High             
149 150
 '''
150 151
 if __name__ == '__main__':
151 152
     # train(input_dim=176, result_class=5, file_path="D:\\data\\quantization\\stock6_5.log", model_name='5d_dnn_seq.h5')
152
-    train(result_class=3, file_path="D:\\data\\quantization\\stock578N_12d_train2.log", model_name='5d_578N_dnn_seq.h5')
153
+    train(result_class=3, file_path="D:\\data\\quantization\\stock580_12d_train2.log", model_name='5d_580_dnn_seq.h5')
153 154
     # resample('D:\\data\\quantization\\stock8_14.log')
154 155
     # mul_train()