Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs @ 10772

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