Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs @ 16244

Last change on this file since 16244 was 16244, checked in by mkommend, 5 years ago

#2955: Used IsProblemDataCompatible and IsDatasetCompatible instead of now obselete AdjustProblemDataProperties when exchanging the problem data of data analysis solutions.

File size: 29.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using HeuristicLab.Common;
26using HeuristicLab.Core;
27using HeuristicLab.Data;
28using HeuristicLab.Parameters;
29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
30
31namespace HeuristicLab.Problems.DataAnalysis.Trading {
32  [StorableClass]
33  [Item("TradingProblemData", "Represents an item containing all data defining a trading problem.")]
34  public sealed class ProblemData : DataAnalysisProblemData, IProblemData {
35    private const string PriceChangeVariableParameterName = "PriceChangeVariable";
36    private const string TransactionCostsParameterName = "TransactionCosts";
37
38    #region default data
39    private static double[,] audInUsdDiff = new double[,] {
40    { 0.0000},
41    { 0.0003},
42    {-0.0004},
43    { 0.0000},
44    { 0.0003},
45    { 0.0003},
46    {-0.0005},
47    { 0.0001},
48    { 0.0004},
49    { 0.0001},
50    {-0.0005},
51    {-0.0014},
52    {-0.0002},
53    { 0.0000},
54    { 0.0011},
55    { 0.0024},
56    {-0.0022},
57    {-0.0035},
58    { 0.0003},
59    { 0.0005},
60    { 0.0014},
61    {-0.0003},
62    { 0.0001},
63    { 0.0001},
64    { 0.0001},
65    { 0.0008},
66    {-0.0004},
67    { 0.0012},
68    { 0.0001},
69    {-0.0001},
70    { 0.0004},
71    {-0.0004},
72    {-0.0007},
73    {-0.0007},
74    {-0.0011},
75    { 0.0001},
76    {-0.0003},
77    {-0.0009},
78    { 0.0001},
79    {-0.0009},
80    { 0.0006},
81    { 0.0006},
82    {-0.0006},
83    { 0.0015},
84    { 0.0003},
85    {-0.0005},
86    {-0.0010},
87    {-0.0005},
88    { 0.0002},
89    {-0.0005},
90    {-0.0002},
91    {-0.0010},
92    { 0.0015},
93    { 0.0001},
94    {-0.0010},
95    {-0.0003},
96    { 0.0004},
97    {-0.0022},
98    { 0.0008},
99    {-0.0007},
100    { 0.0004},
101    { 0.0036},
102    {-0.0005},
103    { 0.0002},
104    { 0.0009},
105    {-0.0002},
106    { 0.0004},
107    { 0.0012},
108    {-0.0005},
109    { 0.0004},
110    {-0.0010},
111    {-0.0006},
112    {-0.0028},
113    { 0.0007},
114    { 0.0009},
115    { 0.0005},
116    {-0.0001},
117    { 0.0001},
118    {-0.0011},
119    { 0.0004},
120    { 0.0007},
121    {-0.0004},
122    { 0.0005},
123    {-0.0008},
124    {-0.0005},
125    {-0.0011},
126    { 0.0004},
127    {-0.0008},
128    { 0.0016},
129    { 0.0008},
130    {-0.0002},
131    { 0.0000},
132    {-0.0015},
133    { 0.0002},
134    {-0.0008},
135    {-0.0005},
136    {-0.0001},
137    { 0.0002},
138    { 0.0038},
139    { 0.0007},
140    {-0.0001},
141    { 0.0000},
142    { 0.0015},
143    { 0.0000},
144    { 0.0009},
145    {-0.0008},
146    {-0.0001},
147    {-0.0006},
148    { 0.0019},
149    {-0.0002},
150    { 0.0002},
151    {-0.0017},
152    {-0.0003},
153    {-0.0004},
154    {-0.0017},
155    { 0.0003},
156    { 0.0000},
157    { 0.0001},
158    { 0.0003},
159    { 0.0006},
160    {-0.0001},
161    {-0.0009},
162    { 0.0007},
163    { 0.0004},
164    { 0.0002},
165    { 0.0001},
166    {-0.0001},
167    {-0.0013},
168    { 0.0009},
169    { 0.0003},
170    { 0.0004},
171    { 0.0001},
172    { 0.0001},
173    { 0.0001},
174    { 0.0007},
175    { 0.0013},
176    { 0.0029},
177    {-0.0011},
178    { 0.0003},
179    { 0.0001},
180    { 0.0003},
181    {-0.0005},
182    { 0.0003},
183    { 0.0004},
184    { 0.0008},
185    {-0.0006},
186    { 0.0005},
187    {-0.0001},
188    { 0.0000},
189    { 0.0003},
190    { 0.0013},
191    { 0.0005},
192    { 0.0002},
193    { 0.0005},
194    {-0.0005},
195    { 0.0012},
196    {-0.0006},
197    { 0.0001},
198    {-0.0012},
199    { 0.0015},
200    {-0.0005},
201    {-0.0005},
202    { 0.0012},
203    {-0.0006},
204    {-0.0001},
205    {-0.0002},
206    { 0.0000},
207    { 0.0003},
208    {-0.0008},
209    { 0.0010},
210    { 0.0003},
211    {-0.0006},
212    { 0.0001},
213    {-0.0001},
214    { 0.0014},
215    {-0.0011},
216    {-0.0002},
217    {-0.0001},
218    { 0.0005},
219    { 0.0006},
220    {-0.0018},
221    {-0.0007},
222    {-0.0001},
223    {-0.0001},
224    { 0.0002},
225    {-0.0008},
226    { 0.0027},
227    { 0.0006},
228    {-0.0005},
229    {-0.0003},
230    {-0.0003},
231    {-0.0001},
232    { 0.0005},
233    { 0.0003},
234    { 0.0004},
235    { 0.0013},
236    { 0.0006},
237    { 0.0000},
238    { 0.0011},
239    { 0.0003},
240    {-0.0008},
241    {-0.0003},
242    { 0.0005},
243    {-0.0004},
244    {-0.0015},
245    {-0.0006},
246    { 0.0008},
247    { 0.0016},
248    {-0.0009},
249    { 0.0007},
250    {-0.0009},
251    {-0.0005},
252    { 0.0001},
253    { 0.0005},
254    { 0.0002},
255    {-0.0011},
256    { 0.0006},
257    {-0.0016},
258    {-0.0013},
259    {-0.0006},
260    {-0.0004},
261    {-0.0002},
262    {-0.0006},
263    { 0.0014},
264    { 0.0002},
265    {-0.0006},
266    {-0.0007},
267    {-0.0001},
268    {-0.0010},
269    {-0.0012},
270    { 0.0009},
271    {-0.0009},
272    {-0.0006},
273    { 0.0000},
274    { 0.0014},
275    {-0.0011},
276    {-0.0002},
277    {-0.0012},
278    {-0.0003},
279    { 0.0003},
280    {-0.0010},
281    {-0.0008},
282    { 0.0001},
283    {-0.0005},
284    {-0.0011},
285    { 0.0006},
286    {-0.0008},
287    { 0.0012},
288    { 0.0007},
289    {-0.0009},
290    { 0.0005},
291    { 0.0017},
292    { 0.0003},
293    {-0.0011},
294    { 0.0034},
295    {-0.0017},
296    {-0.0006},
297    {-0.0008},
298    { 0.0004},
299    {-0.0005},
300    {-0.0006},
301    { 0.0001},
302    { 0.0009},
303    {-0.0036},
304    {-0.0010},
305    { 0.0005},
306    { 0.0000},
307    { 0.0003},
308    {-0.0007},
309    { 0.0021},
310    { 0.0003},
311    { 0.0005},
312    { 0.0003},
313    {-0.0005},
314    {-0.0001},
315    {-0.0011},
316    {-0.0009},
317    { 0.0007},
318    { 0.0003},
319    { 0.0006},
320    { 0.0001},
321    {-0.0002},
322    { 0.0006},
323    { 0.0005},
324    { 0.0005},
325    {-0.0008},
326    {-0.0008},
327    { 0.0005},
328    { 0.0006},
329    {-0.0007},
330    { 0.0003},
331    { 0.0005},
332    { 0.0000},
333    { 0.0003},
334    { 0.0010},
335    {-0.0018},
336    { 0.0003},
337    {-0.0001},
338    { 0.0008},
339    {-0.0015},
340    {-0.0008},
341    { 0.0032},
342    { 0.0009},
343    { 0.0005},
344    {-0.0014},
345    {-0.0003},
346    { 0.0029},
347    { 0.0002},
348    {-0.0002},
349    {-0.0002},
350    { 0.0005},
351    { 0.0008},
352    {-0.0007},
353    { 0.0014},
354    {-0.0004},
355    {-0.0003},
356    { 0.0004},
357    {-0.0001},
358    {-0.0007},
359    { 0.0002},
360    { 0.0002},
361    { 0.0005},
362    { 0.0012},
363    {-0.0018},
364    { 0.0014},
365    { 0.0004},
366    { 0.0012},
367    { 0.0002},
368    { 0.0009},
369    {-0.0007},
370    { 0.0002},
371    { 0.0000},
372    {-0.0011},
373    {-0.0002},
374    { 0.0008},
375    {-0.0010},
376    { 0.0013},
377    {-0.0003},
378    {-0.0001},
379    {-0.0002},
380    { 0.0001},
381    { 0.0003},
382    {-0.0012},
383    { 0.0009},
384    {-0.0003},
385    { 0.0005},
386    {-0.0018},
387    { 0.0013},
388    { 0.0004},
389    { 0.0006},
390    { 0.0003},
391    {-0.0016},
392    {-0.0005},
393    { 0.0005},
394    { 0.0004},
395    { 0.0000},
396    {-0.0007},
397    {-0.0007},
398    { 0.0008},
399    {-0.0007},
400    { 0.0008},
401    { 0.0004},
402    { 0.0003},
403    { 0.0019},
404    { 0.0003},
405    {-0.0004},
406    { 0.0021},
407    {-0.0013},
408    { 0.0006},
409    {-0.0009},
410    { 0.0012},
411    { 0.0011},
412    { 0.0003},
413    { 0.0011},
414    {-0.0003},
415    {-0.0007},
416    { 0.0001},
417    { 0.0009},
418    {-0.0002},
419    {-0.0012},
420    {-0.0010},
421    {-0.0002},
422    {-0.0007},
423    {-0.0001},
424    {-0.0008},
425    { 0.0001},
426    { 0.0001},
427    { 0.0005},
428    { 0.0007},
429    {-0.0004},
430    {-0.0007},
431    {-0.0003},
432    {-0.0005},
433    { 0.0006},
434    { 0.0001},
435    {-0.0012},
436    {-0.0004},
437    { 0.0014},
438    {-0.0005},
439    { 0.0007},
440    {-0.0001},
441    {-0.0002},
442    { 0.0010},
443    {-0.0015},
444    {-0.0003},
445    { 0.0009},
446    { 0.0000},
447    {-0.0009},
448    { 0.0010},
449    { 0.0016},
450    {-0.0002},
451    {-0.0001},
452    {-0.0004},
453    {-0.0011},
454    { 0.0004},
455    { 0.0010},
456    {-0.0007},
457    {-0.0003},
458    {-0.0008},
459    {-0.0012},
460    { 0.0003},
461    { 0.0016},
462    {-0.0019},
463    {-0.0006},
464    { 0.0006},
465    { 0.0006},
466    {-0.0002},
467    {-0.0004},
468    { 0.0003},
469    { 0.0008},
470    {-0.0013},
471    {-0.0012},
472    {-0.0002},
473    {-0.0005},
474    { 0.0010},
475    {-0.0009},
476    {-0.0003},
477    { 0.0016},
478    {-0.0013},
479    { 0.0003},
480    { 0.0003},
481    {-0.0007},
482    { 0.0016},
483    { 0.0002},
484    {-0.0013},
485    {-0.0002},
486    {-0.0009},
487    {-0.0003},
488    { 0.0010},
489    { 0.0002},
490    { 0.0013},
491    {-0.0006},
492    {-0.0006},
493    { 0.0001},
494    {-0.0005},
495    { 0.0018},
496    { 0.0002},
497    { 0.0006},
498    {-0.0002},
499    {-0.0004},
500    { 0.0000},
501    { 0.0016},
502    {-0.0011},
503    {-0.0004},
504    { 0.0002},
505    { 0.0001},
506    { 0.0025},
507    {-0.0011},
508    {-0.0008},
509    { 0.0009},
510    {-0.0001},
511    {-0.0005},
512    {-0.0001},
513    { 0.0005},
514    { 0.0001},
515    {-0.0008},
516    {-0.0001},
517    { 0.0003},
518    { 0.0008},
519    {-0.0011},
520    { 0.0003},
521    { 0.0004},
522    { 0.0005},
523    { 0.0014},
524    {-0.0002},
525    { 0.0008},
526    { 0.0004},
527    { 0.0019},
528    {-0.0005},
529    {-0.0005},
530    {-0.0005},
531    { 0.0000},
532    {-0.0006},
533    { 0.0015},
534    {-0.0011},
535    {-0.0017},
536    {-0.0002},
537    { 0.0007},
538    { 0.0004},
539    {-0.0018},
540    {-0.0001},
541    {-0.0002},
542    {-0.0001},
543    { 0.0005},
544    {-0.0003},
545    { 0.0000},
546    { 0.0007},
547    { 0.0006},
548    {-0.0014},
549    { 0.0006},
550    {-0.0003},
551    { 0.0002},
552    {-0.0002},
553    {-0.0002},
554    { 0.0002},
555    {-0.0009},
556    {-0.0001},
557    {-0.0001},
558    { 0.0000},
559    { 0.0012},
560    { 0.0000},
561    { 0.0003},
562    {-0.0008},
563    { 0.0004},
564    { 0.0000},
565    {-0.0003},
566    {-0.0013},
567    {-0.0005},
568    {-0.0005},
569    {-0.0001},
570    {-0.0004},
571    { 0.0006},
572    { 0.0000},
573    {-0.0008},
574    {-0.0004},
575    {-0.0024},
576    { 0.0003},
577    {-0.0005},
578    { 0.0007},
579    { 0.0003},
580    {-0.0004},
581    {-0.0004},
582    { 0.0003},
583    { 0.0000},
584    { 0.0014},
585    {-0.0004},
586    { 0.0000},
587    {-0.0009},
588    { 0.0012},
589    {-0.0008},
590    { 0.0028},
591    { 0.0003},
592    { 0.0001},
593    { 0.0010},
594    {-0.0005},
595    { 0.0004},
596    {-0.0005},
597    { 0.0001},
598    {-0.0005},
599    { 0.0017},
600    {-0.0012},
601    {-0.0002},
602    { 0.0010},
603    {-0.0009},
604    {-0.0001},
605    { 0.0003},
606    { 0.0001},
607    { 0.0031},
608    {-0.0005},
609    { 0.0004},
610    { 0.0002},
611    {-0.0001},
612    {-0.0003},
613    {-0.0013},
614    {-0.0015},
615    {-0.0003},
616    { 0.0010},
617    { 0.0010},
618    {-0.0002},
619    { 0.0027},
620    { 0.0004},
621    { 0.0001},
622    {-0.0007},
623    { 0.0000},
624    {-0.0002},
625    { 0.0011},
626    {-0.0009},
627    {-0.0003},
628    {-0.0006},
629    { 0.0007},
630    {-0.0015},
631    { 0.0004},
632    {-0.0002},
633    { 0.0002},
634    { 0.0001},
635    {-0.0005},
636    { 0.0000},
637    { 0.0003},
638    {-0.0011},
639    { 0.0001},
640    {-0.0001},
641    { 0.0002},
642    {-0.0006},
643    { 0.0003},
644    {-0.0004},
645    {-0.0005},
646    {-0.0005},
647    { 0.0000},
648    { 0.0007},
649    {-0.0032},
650    { 0.0001},
651    { 0.0007},
652    {-0.0008},
653    {-0.0004},
654    {-0.0004},
655    {-0.0004},
656    { 0.0010},
657    {-0.0001},
658    {-0.0001},
659    { 0.0002},
660    { 0.0000},
661    { 0.0001},
662    {-0.0009},
663    {-0.0002},
664    {-0.0009},
665    {-0.0002},
666    { 0.0002},
667    { 0.0002},
668    { 0.0010},
669    { 0.0002},
670    {-0.0005},
671    {-0.0005},
672    {-0.0021},
673    { 0.0008},
674    { 0.0000},
675    { 0.0006},
676    {-0.0006},
677    {-0.0007},
678    { 0.0007},
679    {-0.0007},
680    { 0.0005},
681    { 0.0011},
682    {-0.0006},
683    {-0.0004},
684    { 0.0012},
685    { 0.0001},
686    { 0.0010},
687    {-0.0002},
688    {-0.0004},
689    {-0.0004},
690    {-0.0003},
691    {-0.0006},
692    { 0.0011},
693    { 0.0000},
694    { 0.0012},
695    { 0.0001},
696    {-0.0003},
697    { 0.0011},
698    { 0.0007},
699    {-0.0007},
700    { 0.0005},
701    {-0.0002},
702    { 0.0008},
703    { 0.0002},
704    { 0.0008},
705    {-0.0002},
706    { 0.0005},
707    { 0.0002},
708    {-0.0009},
709    { 0.0003},
710    {-0.0008},
711    { 0.0004},
712    {-0.0009},
713    { 0.0006},
714    { 0.0011},
715    { 0.0010},
716    { 0.0006},
717    {-0.0006},
718    { 0.0005},
719    { 0.0002},
720    {-0.0035},
721    { 0.0008},
722    {-0.0006},
723    {-0.0011},
724    { 0.0008},
725    {-0.0003},
726    {-0.0005},
727    { 0.0004},
728    { 0.0000},
729    { 0.0002},
730    {-0.0011},
731    { 0.0001},
732    {-0.0009},
733    { 0.0007},
734    {-0.0003},
735    { 0.0005},
736    {-0.0005},
737    { 0.0002},
738    {-0.0021},
739    {-0.0004},
740    { 0.0000},
741    { 0.0014},
742    {-0.0004},
743    {-0.0006},
744    {-0.0031},
745    {-0.0006},
746    { 0.0004},
747    { 0.0001},
748    {-0.0012},
749    {-0.0011},
750    { 0.0004},
751    {-0.0002},
752    { 0.0000},
753    {-0.0004},
754    {-0.0002},
755    { 0.0013},
756    {-0.0007},
757    {-0.0007},
758    { 0.0001},
759    { 0.0001},
760    {-0.0010},
761    { 0.0001},
762    { 0.0006},
763    {-0.0001},
764    {-0.0008},
765    {-0.0015},
766    {-0.0008},
767    {-0.0001},
768    { 0.0010},
769    {-0.0004},
770    { 0.0000},
771    {-0.0016},
772    { 0.0000},
773    { 0.0001},
774    {-0.0004},
775    {-0.0001},
776    { 0.0014},
777    {-0.0025},
778    {-0.0006},
779    {-0.0011},
780    {-0.0002},
781    {-0.0001},
782    {-0.0005},
783    {-0.0005},
784    {-0.0014},
785    { 0.0000},
786    {-0.0007},
787    { 0.0021},
788    { 0.0002},
789    {-0.0005},
790    {-0.0009},
791    {-0.0002},
792    { 0.0020},
793    { 0.0004},
794    {-0.0011},
795    {-0.0018},
796    { 0.0005},
797    { 0.0005},
798    { 0.0000},
799    { 0.0000},
800    { 0.0004},
801    { 0.0008},
802    {-0.0004},
803    {-0.0007},
804    { 0.0001},
805    { 0.0009},
806    {-0.0001},
807    { 0.0010},
808    {-0.0005},
809    {-0.0023},
810    { 0.0004},
811    { 0.0022},
812    {-0.0013},
813    { 0.0003},
814    {-0.0003},
815    {-0.0003},
816    { 0.0010},
817    {-0.0002},
818    { 0.0000},
819    { 0.0002},
820    {-0.0004},
821    {-0.0007},
822    {-0.0005},
823    {-0.0003},
824    { 0.0005},
825    {-0.0010},
826    {-0.0004},
827    { 0.0001},
828    { 0.0003},
829    { 0.0000},
830    { 0.0008},
831    { 0.0001},
832    { 0.0004},
833    { 0.0002},
834    { 0.0001},
835    {-0.0005},
836    {-0.0005},
837    {-0.0003},
838    { 0.0016},
839    { 0.0006},
840    {-0.0014},
841    { 0.0016},
842    { 0.0016},
843    { 0.0009},
844    {-0.0002},
845    {-0.0002},
846    { 0.0005},
847    {-0.0005},
848    {-0.0004},
849    {-0.0008},
850    {-0.0003},
851    {-0.0001},
852    { 0.0005},
853    {-0.0002},
854    {-0.0004},
855    {-0.0003},
856    { 0.0003},
857    { 0.0003},
858    {-0.0003},
859    { 0.0003},
860    {-0.0004},
861    { 0.0000},
862    {-0.0008},
863    {-0.0013},
864    { 0.0007},
865    {-0.0011},
866    { 0.0015},
867    {-0.0008},
868    { 0.0007},
869    {-0.0002},
870    {-0.0004},
871    { 0.0005},
872    {-0.0008},
873    { 0.0000},
874    {-0.0008},
875    { 0.0007},
876    { 0.0007},
877    { 0.0011},
878    { 0.0000},
879    { 0.0003},
880    {-0.0005},
881    { 0.0003},
882    { 0.0012},
883    { 0.0005},
884    {-0.0006},
885    {-0.0002},
886    {-0.0007},
887    {-0.0027},
888    {-0.0012},
889    {-0.0005},
890    { 0.0005},
891    { 0.0002},
892    { 0.0001},
893    { 0.0003},
894    { 0.0003},
895    { 0.0002},
896    {-0.0002},
897    {-0.0003},
898    { 0.0009},
899    { 0.0003},
900    { 0.0003},
901    { 0.0006},
902    {-0.0002},
903    {-0.0003},
904    {-0.0004},
905    { 0.0011},
906    { 0.0000},
907    { 0.0000},
908    { 0.0000},
909    {-0.0007},
910    { 0.0001},
911    { 0.0019},
912    { 0.0011},
913    {-0.0011},
914    { 0.0002},
915    { 0.0009},
916    { 0.0002},
917    { 0.0004},
918    {-0.0001},
919    {-0.0008},
920    { 0.0001},
921    { 0.0003},
922    {-0.0002},
923    {-0.0002},
924    { 0.0002},
925    { 0.0003},
926    { 0.0000},
927    { 0.0010},
928    { 0.0013},
929    {-0.0004},
930    {-0.0009},
931    {-0.0005},
932    { 0.0018},
933    { 0.0018},
934    {-0.0006},
935    {-0.0006},
936    {-0.0009},
937    { 0.0005},
938    {-0.0004},
939    {-0.0001},
940    { 0.0012},
941    {-0.0002},
942    {-0.0006},
943    {-0.0024},
944    {-0.0002},
945    {-0.0011},
946    { 0.0003},
947    { 0.0009},
948    { 0.0002},
949    { 0.0002},
950    { 0.0003},
951    {-0.0002},
952    {-0.0002},
953    { 0.0000},
954    { 0.0000},
955    {-0.0010},
956    {-0.0007},
957    { 0.0009},
958    { 0.0001},
959    { 0.0020},
960    { 0.0001},
961    { 0.0005},
962    {-0.0003},
963    { 0.0004},
964    {-0.0005},
965    { 0.0005},
966    { 0.0002},
967    { 0.0001},
968    { 0.0001},
969    { 0.0004},
970    { 0.0008},
971    { 0.0000},
972    {-0.0008},
973    { 0.0002},
974    {-0.0012},
975    {-0.0004},
976    { 0.0004},
977    {-0.0001},
978    { 0.0010},
979    {-0.0009},
980    {-0.0007},
981    {-0.0006},
982    {-0.0002},
983    { 0.0001},
984    {-0.0004},
985    { 0.0002},
986    { 0.0000},
987    { 0.0000},
988    {-0.0012},
989    {-0.0002},
990    {-0.0002},
991    { 0.0009},
992    {-0.0008},
993    {-0.0001},
994    { 0.0008},
995    {-0.0001},
996    {-0.0002},
997    {-0.0004},
998    { 0.0009},
999    { 0.0001},
1000    { 0.0005},
1001    { 0.0015},
1002    {-0.0001},
1003    {-0.0002},
1004    {-0.0004},
1005    { 0.0009},
1006    {-0.0010},
1007    {-0.0005},
1008    { 0.0004},
1009    { 0.0011},
1010    { 0.0009},
1011    {-0.0003},
1012    {-0.0002},
1013    { 0.0006},
1014    { 0.0003},
1015    {-0.0003},
1016    {-0.0002},
1017    { 0.0015},
1018    { 0.0003},
1019    { 0.0001},
1020    {-0.0001},
1021    {-0.0001},
1022    {-0.0005},
1023    {-0.0001},
1024    { 0.0003},
1025    { 0.0002},
1026    { 0.0001},
1027    {-0.0002},
1028    {-0.0008},
1029    { 0.0003},
1030    {-0.0001},
1031    { 0.0000},
1032    { 0.0002},
1033    {-0.0002},
1034    {-0.0001},
1035    {-0.0005},
1036    { 0.0002},
1037    { 0.0000},
1038    { 0.0000},
1039    { 0.0004},
1040    { 0.0000},
1041    {-0.0013},
1042    {-0.0043},
1043    { 0.0007},
1044    { 0.0001},
1045    {-0.0007},
1046    {-0.0001},
1047    { 0.0003},
1048    { 0.0013},
1049    { 0.0005},
1050    {-0.0007},
1051    { 0.0002},
1052    {-0.0014},
1053    {-0.0002},
1054    { 0.0000},
1055    { 0.0020},
1056    { 0.0009},
1057    {-0.0018},
1058    {-0.0005},
1059    {-0.0009},
1060    {-0.0005},
1061    { 0.0008},
1062    { 0.0005},
1063    {-0.0004},
1064    { 0.0004},
1065    { 0.0001},
1066    { 0.0003},
1067    { 0.0003},
1068    {-0.0008},
1069    {-0.0007},
1070    { 0.0008},
1071    {-0.0004},
1072    {-0.0028},
1073    {-0.0006},
1074    {-0.0022},
1075    {-0.0009},
1076    { 0.0003},
1077    { 0.0003},
1078    { 0.0000},
1079    { 0.0021},
1080    {-0.0017},
1081    { 0.0009},
1082    {-0.0001},
1083    {-0.0005},
1084    {-0.0015},
1085    { 0.0009},
1086    { 0.0009},
1087    {-0.0009},
1088    { 0.0010},
1089    { 0.0000},
1090    { 0.0018},
1091    {-0.0011},
1092    { 0.0001},
1093    {-0.0008},
1094    { 0.0009},
1095    { 0.0022},
1096    { 0.0011},
1097    {-0.0002},
1098    {-0.0018},
1099    { 0.0019},
1100    {-0.0004},
1101    {-0.0004},
1102    { 0.0002},
1103    { 0.0027},
1104    {-0.0012},
1105    {-0.0003},
1106    {-0.0002},
1107    { 0.0013},
1108    { 0.0002},
1109    {-0.0003},
1110    { 0.0002},
1111    { 0.0003},
1112    {-0.0002},
1113    { 0.0020},
1114    {-0.0003},
1115    { 0.0002},
1116    {-0.0001},
1117    {-0.0001},
1118    { 0.0006},
1119    {-0.0012},
1120    { 0.0011},
1121    { 0.0001},
1122    { 0.0001},
1123    { 0.0004},
1124    {-0.0002},
1125    { 0.0029},
1126    {-0.0016},
1127    { 0.0005},
1128    {-0.0029},
1129    {-0.0002},
1130    { 0.0013},
1131    { 0.0011},
1132    {-0.0003},
1133    { 0.0002},
1134    { 0.0001},
1135    { 0.0001},
1136    {-0.0005},
1137    { 0.0000},
1138    { 0.0009},
1139    { 0.0016},
1140    { 0.0005},
1141    { 0.0003},
1142    { 0.0004},
1143    {-0.0001},
1144    { 0.0020},
1145    { 0.0006},
1146    {-0.0006},
1147    {-0.0004},
1148    { 0.0012},
1149    { 0.0012},
1150    { 0.0017},
1151    { 0.0017},
1152    {-0.0004},
1153    { 0.0001},
1154    { 0.0001},
1155    {-0.0006},
1156    {-0.0003},
1157    { 0.0004},
1158    { 0.0008},
1159    {-0.0014},
1160    { 0.0011},
1161    {-0.0003},
1162    { 0.0004},
1163    {-0.0001},
1164    { 0.0017},
1165    { 0.0008},
1166    { 0.0005},
1167    {-0.0002},
1168    { 0.0001},
1169    {-0.0013},
1170    { 0.0009},
1171    {-0.0008},
1172    {-0.0003},
1173    { 0.0013},
1174    {-0.0002},
1175    {-0.0004},
1176    { 0.0007},
1177    {-0.0009},
1178    { 0.0002},
1179    {-0.0002},
1180    {-0.0006},
1181    { 0.0003},
1182    {-0.0003},
1183    {-0.0004},
1184    {-0.0006},
1185    {-0.0004},
1186    { 0.0006},
1187    {-0.0006},
1188    { 0.0019},
1189    {-0.0012},
1190    {-0.0002},
1191    { 0.0003},
1192    { 0.0001},
1193    { 0.0001},
1194    { 0.0002},
1195    { 0.0004},
1196    { 0.0000},
1197    {-0.0013},
1198    {-0.0017},
1199    {-0.0017},
1200    {-0.0006},
1201    {-0.0003},
1202    { 0.0006},
1203    { 0.0001},
1204    { 0.0007},
1205    {-0.0004},
1206    { 0.0000},
1207    { 0.0019},
1208    {-0.0008},
1209    {-0.0006},
1210    { 0.0003},
1211    {-0.0004},
1212    {-0.0002},
1213    { 0.0008},
1214    {-0.0007},
1215    {-0.0004},
1216    {-0.0001},
1217    {-0.0004},
1218    {-0.0003},
1219    { 0.0004},
1220    {-0.0008},
1221    { 0.0015},
1222    { 0.0011},
1223    {-0.0013},
1224    {-0.0003},
1225    { 0.0000},
1226    { 0.0006},
1227    {-0.0003},
1228    {-0.0003},
1229    { 0.0005},
1230    {-0.0016},
1231    { 0.0005},
1232    {-0.0002},
1233    {-0.0009},
1234    {-0.0001},
1235    {-0.0004},
1236    { 0.0007},
1237    { 0.0004},
1238    { 0.0015},
1239    { 0.0005},
1240    {-0.0007},
1241    { 0.0002},
1242    {-0.0007},
1243    {-0.0009},
1244    {-0.0029},
1245    { 0.0003},
1246    {-0.0002},
1247    {-0.0010},
1248    {-0.0001},
1249    { 0.0005},
1250    {-0.0003},
1251    { 0.0002},
1252    {-0.0006},
1253    { 0.0008},
1254    {-0.0010},
1255    { 0.0005},
1256    { 0.0003},
1257    { 0.0009},
1258    { 0.0002},
1259    { 0.0001},
1260    { 0.0002},
1261    {-0.0010},
1262    {-0.0017},
1263    { 0.0004},
1264    {-0.0007},
1265    { 0.0019},
1266    {-0.0001},
1267    {-0.0004},
1268    {-0.0023},
1269    { 0.0015},
1270    { 0.0009},
1271    {-0.0006},
1272    {-0.0001},
1273    { 0.0000},
1274    { 0.0001},
1275    { 0.0003},
1276    {-0.0002},
1277    { 0.0039},
1278    {-0.0007},
1279    { 0.0000},
1280    {-0.0002},
1281    {-0.0005},
1282    { 0.0007},
1283    { 0.0010},
1284    {-0.0004},
1285    { 0.0006},
1286    {-0.0003},
1287    {-0.0006},
1288    { 0.0003},
1289    { 0.0022},
1290    {-0.0030},
1291    { 0.0010},
1292    { 0.0005},
1293    { 0.0000},
1294    {-0.0005},
1295    {-0.0004},
1296    {-0.0010},
1297    {-0.0001},
1298    { 0.0000},
1299    {-0.0002},
1300    { 0.0003},
1301    {-0.0003},
1302    {-0.0007},
1303    {-0.0001},
1304    { 0.0016},
1305    {-0.0009},
1306    { 0.0001},
1307    { 0.0005},
1308    { 0.0016},
1309    {-0.0013},
1310    {-0.0003},
1311    {-0.0002},
1312    { 0.0014},
1313    {-0.0008},
1314    { 0.0026},
1315    {-0.0003},
1316    { 0.0007},
1317    { 0.0011},
1318    { 0.0005},
1319    {-0.0001},
1320    { 0.0004},
1321    {-0.0003},
1322    { 0.0006},
1323    {-0.0013},
1324    { 0.0002},
1325    {-0.0003},
1326    {-0.0010},
1327    { 0.0000},
1328    {-0.0007},
1329    {-0.0001},
1330    { 0.0008},
1331    {-0.0010},
1332    {-0.0005},
1333    { 0.0010},
1334    { 0.0013},
1335    { 0.0008},
1336    {-0.0004},
1337    { 0.0020},
1338    {-0.0002},
1339    { 0.0005},
1340    { 0.0003},
1341    { 0.0004},
1342    { 0.0005},
1343    { 0.0007},
1344    {-0.0008},
1345    { 0.0003},
1346    {-0.0008},
1347    { 0.0011},
1348    { 0.0005},
1349    { 0.0002},
1350    {-0.0005},
1351    {-0.0011},
1352    { 0.0001},
1353    {-0.0002},
1354    {-0.0003},
1355    { 0.0016},
1356    {-0.0005},
1357    {-0.0002},
1358    {-0.0008},
1359    { 0.0023},
1360    { 0.0015},
1361    { 0.0001},
1362    {-0.0004},
1363    { 0.0015},
1364    {-0.0002},
1365    { 0.0003},
1366    { 0.0001},
1367    { 0.0002},
1368    {-0.0007},
1369    { 0.0005},
1370    {-0.0001},
1371    { 0.0007},
1372    {-0.0007},
1373    { 0.0018},
1374    {-0.0002},
1375    { 0.0005},
1376    {-0.0002},
1377    {-0.0004},
1378    {-0.0001},
1379    {-0.0001},
1380    { 0.0002},
1381    { 0.0009},
1382    { 0.0003},
1383    {-0.0006},
1384    {-0.0003},
1385    {-0.0022},
1386    { 0.0002},
1387    { 0.0004},
1388    { 0.0004},
1389    {-0.0005},
1390    {-0.0008},
1391    {-0.0001},
1392    { 0.0000},
1393    { 0.0010},
1394    { 0.0001},
1395    {-0.0005},
1396    {-0.0003},
1397    {-0.0005},
1398    { 0.0005},
1399    {-0.0003},
1400    { 0.0000},
1401    { 0.0002},
1402    { 0.0001},
1403    {-0.0014},
1404    {-0.0005},
1405    {-0.0001},
1406    { 0.0006},
1407    { 0.0004},
1408    { 0.0005},
1409    { 0.0017},
1410    { 0.0009},
1411    { 0.0008},
1412    { 0.0017},
1413    { 0.0006},
1414    {-0.0003},
1415    { 0.0004},
1416    { 0.0000},
1417    {-0.0015},
1418    {-0.0001},
1419    { 0.0000},
1420    {-0.0008},
1421    { 0.0000},
1422    { 0.0004},
1423    {-0.0006},
1424    { 0.0001},
1425    { 0.0001},
1426    { 0.0003},
1427    {-0.0001},
1428    { 0.0001},
1429    {-0.0011},
1430    {-0.0011},
1431    { 0.0010},
1432    { 0.0004},
1433    { 0.0008},
1434    { 0.0007},
1435    { 0.0004},
1436    {-0.0023},
1437    { 0.0023},
1438    {-0.0001},
1439    {-0.0004},
1440    { 0.0000},
1441    {-0.0003},
1442    {-0.0008},
1443    { 0.0005},
1444    { 0.0004},
1445    {-0.0004},
1446    { 0.0001},
1447    {-0.0007},
1448    {-0.0001},
1449    {-0.0006},
1450    {-0.0012},
1451    {-0.0027},
1452    { 0.0002},
1453    {-0.0012},
1454    { 0.0013},
1455    { 0.0000},
1456    {-0.0008},
1457    { 0.0009},
1458    {-0.0015},
1459    { 0.0007},
1460    { 0.0002},
1461    { 0.0001},
1462    {-0.0013},
1463    { 0.0002},
1464    {-0.0004},
1465    {-0.0002},
1466    {-0.0027},
1467    { 0.0013},
1468    {-0.0005},
1469    { 0.0006},
1470    { 0.0000},
1471    {-0.0005},
1472    { 0.0011},
1473    { 0.0000},
1474    {-0.0003},
1475    { 0.0018},
1476    {-0.0003},
1477    { 0.0006},
1478    {-0.0008},
1479    {-0.0006},
1480    {-0.0015},
1481    {-0.0009},
1482    {-0.0017},
1483    { 0.0005},
1484    { 0.0007},
1485    {-0.0006},
1486    {-0.0004},
1487    { 0.0016},
1488    { 0.0000},
1489    { 0.0003},
1490    {-0.0019},
1491    { 0.0003},
1492    { 0.0005},
1493    { 0.0003},
1494    { 0.0001},
1495    {-0.0002},
1496    { 0.0007},
1497    { 0.0001},
1498    {-0.0012},
1499    { 0.0008},
1500    {-0.0011},
1501    { 0.0008},
1502    { 0.0010},
1503    {-0.0003},
1504    {-0.0003},
1505    {-0.0006},
1506    {-0.0004},
1507    { 0.0000},
1508    { 0.0011},
1509    { 0.0003},
1510    {-0.0005},
1511    {-0.0002},
1512    { 0.0001},
1513    {-0.0004},
1514    { 0.0008},
1515    {-0.0007},
1516    {-0.0005},
1517    {-0.0005},
1518    {-0.0003},
1519    {-0.0005},
1520    { 0.0006},
1521    {-0.0014},
1522    {-0.0001},
1523    { 0.0003},
1524    { 0.0009},
1525    { 0.0012},
1526    {-0.0023},
1527    {-0.0004},
1528    { 0.0002},
1529    { 0.0001},
1530    {-0.0019},
1531    { 0.0012},
1532    {-0.0022},
1533    { 0.0001},
1534    {-0.0004},
1535    {-0.0001},
1536    { 0.0012},
1537    { 0.0001},
1538    { 0.0000},
1539    { 0.0004},
1540    {-0.0008},
1541    { 0.0006},
1542    {-0.0007},
1543    { 0.0008},
1544    {-0.0009},
1545    {-0.0005},
1546    {-0.0001},
1547    {-0.0004},
1548    { 0.0001},
1549    {-0.0005},
1550    {-0.0004},
1551    {-0.0012},
1552    { 0.0002},
1553    { 0.0011},
1554    { 0.0008},
1555    {-0.0009},
1556    { 0.0010},
1557    {-0.0003},
1558    {-0.0006},
1559    { 0.0005},
1560    { 0.0002},
1561    {-0.0003},
1562    { 0.0016},
1563    {-0.0006},
1564    { 0.0000},
1565    { 0.0008},
1566    {-0.0002},
1567    { 0.0000},
1568    { 0.0000},
1569    { 0.0003},
1570    {-0.0011},
1571    {-0.0009},
1572    {-0.0013},
1573    {-0.0003},
1574    { 0.0009},
1575    { 0.0007},
1576    {-0.0005},
1577    { 0.0012},
1578    {-0.0009},
1579    { 0.0004},
1580    {-0.0008},
1581    {-0.0011},
1582    { 0.0013},
1583    { 0.0013},
1584    { 0.0005 }};
1585
1586    private static Dataset defaultDataset;
1587    private static IEnumerable<string> defaultAllowedInputVariables;
1588    private static string defaultPriceVariable;
1589
1590    static ProblemData() {
1591      defaultDataset = new Dataset(new string[] { "d(AUD/USD)/dt" }, audInUsdDiff);
1592      defaultDataset.Name = "AUD in USD";
1593      defaultDataset.Description = "Australian dollar in US dollar.";
1594      defaultAllowedInputVariables = new List<string>() { "d(AUD/USD)/dt" };
1595      defaultPriceVariable = "d(AUD/USD)/dt";
1596    }
1597    #endregion
1598
1599    public IConstrainedValueParameter<StringValue> PriceChangeVariableParameter {
1600      get { return (IConstrainedValueParameter<StringValue>)Parameters[PriceChangeVariableParameterName]; }
1601    }
1602    public IValueParameter<DoubleValue> TransactionCostsParameter {
1603      get { return (IValueParameter<DoubleValue>)Parameters[TransactionCostsParameterName]; }
1604    }
1605    public string PriceChangeVariable {
1606      get { return PriceChangeVariableParameter.Value.Value; }
1607    }
1608    public double TransactionCosts {
1609      get { return TransactionCostsParameter.Value.Value; }
1610    }
1611
1612    [StorableConstructor]
1613    private ProblemData(bool deserializing) : base(deserializing) { }
1614    [StorableHook(HookType.AfterDeserialization)]
1615    private void AfterDeserialization() {
1616      RegisterParameterEvents();
1617    }
1618
1619    private ProblemData(ProblemData original, Cloner cloner)
1620      : base(original, cloner) {
1621      RegisterParameterEvents();
1622    }
1623    public override IDeepCloneable Clone(Cloner cloner) { return new ProblemData(this, cloner); }
1624
1625    public ProblemData()
1626      : this(defaultDataset, defaultAllowedInputVariables, defaultPriceVariable) {
1627    }
1628
1629    public ProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
1630      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
1631      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
1632      Parameters.Add(new ConstrainedValueParameter<StringValue>(PriceChangeVariableParameterName, new ItemSet<StringValue>(variables), variables.First(x => x.Value == targetVariable)));
1633      Parameters.Add(new FixedValueParameter<DoubleValue>(TransactionCostsParameterName, "The absolute cost of on buy/sell transaction (assumed to be constant and independent of transaction volume)", new DoubleValue(0.0002)));
1634
1635      if (dataset.GetReadOnlyDoubleValues(targetVariable).Min() >= 0) throw new ArgumentException("The target variable must contain changes (deltas) of the asset price over time.");
1636
1637      RegisterParameterEvents();
1638    }
1639
1640    private void RegisterParameterEvents() {
1641      PriceChangeVariableParameter.ValueChanged += new EventHandler(PriceVariableParameter_ValueChanged);
1642      TransactionCostsParameter.Value.ValueChanged += new EventHandler(TransactionCostsParameter_ValueChanged);
1643    }
1644
1645    private void TransactionCostsParameter_ValueChanged(object sender, EventArgs e) {
1646      OnChanged();
1647    }
1648    private void PriceVariableParameter_ValueChanged(object sender, EventArgs e) {
1649      if (Dataset.GetReadOnlyDoubleValues(PriceChangeVariable).Min() >= 0) throw new ArgumentException("The target variable must contain changes (deltas) of the asset price over time.");
1650      OnChanged();
1651    }
1652  }
1653}
Note: See TracBrowser for help on using the repository browser.