-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdata_test.go
219 lines (216 loc) · 6.03 KB
/
data_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
package ma_test
import (
"math/big"
)
var (
bigPrices = floatToBig(prices)
prices = []float64{
459.99,
448.85,
446.06,
450.81,
442.8,
448.97,
444.57,
441.4,
430.47,
420.05,
431.14,
425.66,
430.58,
431.72,
437.87,
428.43,
428.35,
432.5,
443.66,
455.72,
454.49,
452.08,
452.73,
461.91,
463.58,
461.14,
452.08,
442.66,
428.91,
429.79,
431.99,
427.72,
423.2,
426.21,
426.98,
435.69,
434.33,
429.8,
419.85,
426.24,
402.8,
392.05,
390.53,
398.67,
406.13,
405.46,
408.38,
417.2,
430.12,
442.78,
439.29,
445.52,
449.98,
460.71,
458.66,
463.84,
456.77,
452.97,
454.74,
443.86,
428.85,
434.58,
433.26,
442.93,
439.66,
441.35,
}
results = []float64{
7.70337838145673003964475356042385101318359375,
6.41607475695587936570518650114536285400390625,
4.23751978326481548720039427280426025390625000,
2.55258332486573635833337903022766113281250000,
1.37888571985365615546470507979393005371093750,
0.10298149119910249282838776707649230957031250,
-1.25840195280312627801322378218173980712890625,
-2.07055819009491415272350423038005828857421875,
-2.62184232825688923185225576162338256835937500,
-2.32906674045494810343370772898197174072265625,
-2.18163211479298979611485265195369720458984375,
-2.40262627286642782564740628004074096679687500,
-3.34212168135286447068210691213607788085937500,
-3.53036313607753982068970799446105957031250000,
-5.50747124862732562178280204534530639648437500,
-7.85127422856083967417362146079540252685546875,
-9.71936745524880052471417002379894256591796875,
-10.42286650800718916798359714448451995849609375,
-10.26016215893747585141682066023349761962890625,
-10.06920961013429405284114181995391845703125000,
-9.57191961195360363490181043744087219238281250,
-8.36963349244507526236702688038349151611328125,
-6.30163572368542190815787762403488159179687500,
-3.59968150914517082128440961241722106933593750,
-1.72014836089687150888494215905666351318359375,
0.26900323229938294389285147190093994140625000,
2.18017324711348692289902828633785247802734375,
4.50863780861044460834818892180919647216796875,
6.11802015384472497316892258822917938232421875,
7.72243059351438887460972182452678680419921875,
8.32745380871403995115542784333229064941406250,
8.40344118462587630347115918993949890136718750,
8.50840632319352607737528160214424133300781250,
7.62576184402922763183596543967723846435546875,
5.64994908292868558419286273419857025146484375,
4.49465476488205695204669609665870666503906250,
3.43298936168440604888019151985645294189453125,
3.33347385363293824411812238395214080810546875,
2.95666285611525836429791525006294250488281250,
2.76256121582525793201057240366935729980468750,
}
smaResults = []float64{
440.51200000000005729816621169447898864746093750,
438.19300000000004047251422889530658721923828125,
436.64500000000009549694368615746498107910156250,
434.73600000000004683897714130580425262451171875,
434.24300000000005184119800105690956115722656250,
432.18900000000002137312549166381359100341796875,
430.56700000000000727595761418342590332031250000,
429.67699999999996407495927996933460235595703125,
430.99599999999992405719240196049213409423828125,
434.56299999999993133315001614391803741455078125,
436.89799999999996771293808706104755401611328125,
439.53999999999996362021192908287048339843750000,
441.75499999999993860910763032734394073486328125,
444.77400000000000090949470177292823791503906250,
447.34499999999997044142219237983226776123046875,
450.61599999999998544808477163314819335937500000,
452.98899999999991905497154220938682556152343750,
454.00499999999993860910763032734394073486328125,
452.52999999999991587174008600413799285888671875,
449.93700000000001182343112304806709289550781250,
447.68700000000001182343112304806709289550781250,
445.25100000000003319655661471188068389892578125,
442.29799999999994497557054273784160614013671875,
438.72799999999995179678080603480339050292968750,
435.06800000000004047251422889530658721923828125,
432.52300000000002455635694786906242370605468750,
430.74800000000004729372449219226837158203125000,
429.46200000000010277290130034089088439941406250,
428.55600000000004001776687800884246826171875000,
428.20100000000002182787284255027770996093750000,
425.28199999999998226485331542789936065673828125,
421.71499999999997498889570124447345733642578125,
418.44800000000003592504072003066539764404296875,
415.69400000000007366907084360718727111816406250,
413.60900000000003728928277269005775451660156250,
410.58600000000006957634468562901020050048828125,
407.99100000000009913492249324917793273925781250,
406.73100000000005138645065017044544219970703125,
407.75799999999998135535861365497112274169921875,
409.41199999999997771737980656325817108154296875,
413.06099999999997862687450833618640899658203125,
418.40800000000001546140993013978004455566406250,
424.35299999999995179678080603480339050292968750,
430.55699999999995952748577110469341278076171875,
435.80999999999994543031789362430572509765625000,
441.64799999999996771293808706104755401611328125,
446.48699999999996634869603440165519714355468750,
450.06399999999996452970663085579872131347656250,
452.52599999999995361577020958065986633300781250,
452.63399999999990086507750675082206726074218750,
451.58999999999997498889570124447345733642578125,
450.49599999999998090061126276850700378417968750,
448.82399999999995543475961312651634216308593750,
447.04599999999999226929503493010997772216796875,
445.14600000000001500666257925331592559814453125,
442.89699999999993451638147234916687011718750000,
}
signalResults = []*bool{
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
&[]bool{true}[0],
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
&[]bool{false}[0],
nil,
nil,
nil,
nil,
}
)
func floatToBig(s []float64) (b []*big.Float) {
l := len(s)
b = make([]*big.Float, l)
for i := 0; i < l; i++ {
b[i] = big.NewFloat(s[i])
}
return b
}