|
@@ -16,18 +16,18 @@ from keras.callbacks import EarlyStopping
|
16
|
16
|
|
17
|
17
|
early_stopping = EarlyStopping(monitor='accuracy', patience=5, verbose=2)
|
18
|
18
|
|
19
|
|
-epochs= 38
|
|
19
|
+epochs= 77
|
20
|
20
|
# size = 24000 #共68W
|
21
|
|
-file_path = 'D:\\data\\quantization\\week112_18d_train1.log'
|
22
|
|
-model_path = '112_18d_mix_3W_s_seq.h5'
|
|
21
|
+file_path = 'D:\\data\\quantization\\week120_18d_train1.log'
|
|
22
|
+model_path = '120_18d_mix_3W_s_seqA.h5'
|
23
|
23
|
row = 18
|
24
|
|
-col = 11
|
25
|
|
-col1 = 17
|
|
24
|
+col = 9
|
|
25
|
+col1 = 13
|
26
|
26
|
'''
|
27
|
27
|
0 18-3 18*11 25,102,47-29
|
28
|
28
|
1 18W预测3周后最高价+pe 18*11 37,101,44-22
|
29
|
29
|
2 18*11 + 11*16 33,101,41-30
|
30
|
|
-3 stripe=1,win=4-3 18*11 + 11*16 38,104,32-20 ----- 随机25,100,51-26
|
|
30
|
+3 stripe=1,win=4-3 18*11 + 11*16 31,108,19-34 ----- 随机25,100,51-26
|
31
|
31
|
4 stripe=1,win=3 18*11 + 11*16 34,103,41-26
|
32
|
32
|
5 stripe=1,win=3 18*11
|
33
|
33
|
6 用ma来衡量
|
|
@@ -37,8 +37,17 @@ col1 = 17
|
37
|
37
|
10 ma5-大盘相关+alpha_53+alpha_18 48,97,61-06
|
38
|
38
|
|
39
|
39
|
11 high-大盘相关+alpha_53+alpha_18 35,103,39-37
|
40
|
|
-12 high-大盘相关+alpha_53+alpha_18(每日) 18*11 + 11*17
|
|
40
|
+12 high-大盘相关+alpha_53+alpha_18(每日) 18*11 + 11*17 33,101,46-30
|
41
|
41
|
13 high-大盘相关+alpha_53+alpha_18-dmi 18*6 + 11*16 37,105,33-32
|
|
42
|
+
|
|
43
|
+14 high-大盘相关+alpha_53+alpha_18-dmi+result修改(自己对比) 18*6 + 11*16 17,97,59
|
|
44
|
+15 high-大盘相关+alpha_53+alpha_18+result修改-波动-ma+dmi 18*9 + 11*14 26,99,53-22 !!!
|
|
45
|
+16 high-pettm 18*9 + 11*13 29,99,54-26
|
|
46
|
+17 high+大盘相关 18*9 + 11*13 26,98,54-27
|
|
47
|
+
|
|
48
|
+18 high-大盘相关+alpha_53+alpha_18+result修改-波动-ma+dmi 8周后 18*9 + 11*14 19,111,8,55 16 ----- 随机24,100,49
|
|
49
|
+19 high-大盘相关+alpha_53+alpha_18+result修改-波动-ma+dmi 4周后 18*9 + 11*14 26,113,2,22 73条数据
|
|
50
|
+20 high-大盘相关+alpha_53+alpha_18+result修改-波动-ma+双dmi 4周后 18*9 + 11*13 32,110,11,26 大盘超好的时候可以用这种
|
42
|
51
|
'''
|
43
|
52
|
|
44
|
53
|
def read_data(path):
|
|
@@ -101,7 +110,7 @@ def create_mlp(dim, regress=False):
|
101
|
110
|
return model
|
102
|
111
|
|
103
|
112
|
|
104
|
|
-def create_cnn(width, height, depth, size=48, kernel_size=(5, 6), regress=False, output=24):
|
|
113
|
+def create_cnn(width, height, depth, size=48, kernel_size=(5, 6), regress=False, output=24, strides=2):
|
105
|
114
|
# initialize the input shape and channel dimension, assuming
|
106
|
115
|
# TensorFlow/channels-last ordering
|
107
|
116
|
inputShape = (width, height, 1)
|
|
@@ -111,7 +120,7 @@ def create_cnn(width, height, depth, size=48, kernel_size=(5, 6), regress=False,
|
111
|
120
|
inputs = Input(shape=inputShape)
|
112
|
121
|
# x = inputs
|
113
|
122
|
# CONV => RELU => BN => POOL
|
114
|
|
- x = Conv2D(size, kernel_size, strides=2, padding="same")(inputs)
|
|
123
|
+ x = Conv2D(size, kernel_size, strides=strides, padding="same")(inputs)
|
115
|
124
|
x = Activation("relu")(x)
|
116
|
125
|
x = BatchNormalization(axis=chanDim)(x)
|
117
|
126
|
|
|
@@ -148,7 +157,7 @@ mlp = create_mlp(train_x_c.shape[1], regress=False)
|
148
|
157
|
cnn_0 = create_cnn(row, col, 1, kernel_size=(4, col), size=66, regress=False, output=66) # 29 98 47
|
149
|
158
|
# cnn_0 = create_cnn(18, 20, 1, kernel_size=(9, 9), size=90, regress=False, output=96) # 28 97 53
|
150
|
159
|
# cnn_0 = create_cnn(18, 20, 1, kernel_size=(3, 20), size=90, regress=False, output=96)
|
151
|
|
-cnn_1 = create_cnn(11, col1, 1, kernel_size=(3, col1), size=66, regress=False, output=66)
|
|
160
|
+cnn_1 = create_cnn(11, col1, 1, kernel_size=(3, col1), size=66, regress=False, output=66, strides=1)
|
152
|
161
|
# cnn_1 = create_cnn(9, 26, 1, kernel_size=(2, 14), size=36, regress=False, output=64)
|
153
|
162
|
|
154
|
163
|
# create the input to our final set of layers as the *output* of both
|