Changeset 10020 for stable/HeuristicLab.Problems.DataAnalysis.Trading.Views/3.4/SolutionLineChartView.cs
- Timestamp:
- 10/02/13 17:04:43 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Trading.Views/3.4/SolutionLineChartView.cs
r9796 r10020 53 53 this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; 54 54 this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true; 55 this.chart.ChartAreas[0].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount; 56 this.chart.ChartAreas[0].AxisY2.ScaleView.Zoomable = false; 57 this.chart.ChartAreas[0].AxisY2.IntervalAutoMode = IntervalAutoMode.VariableCount; 58 this.chart.ChartAreas[0].AxisY2.LabelStyle.Enabled = false; 59 this.chart.ChartAreas[0].AxisY2.MajorGrid.Enabled = false; 60 this.chart.ChartAreas[0].AxisY2.MinorGrid.Enabled = false; 61 this.chart.ChartAreas[0].AxisY2.MajorTickMark.Enabled = false; 62 this.chart.ChartAreas[0].AxisY2.MinorTickMark.Enabled = false; 55 63 this.chart.ChartAreas[0].CursorY.Interval = 0; 56 64 } … … 59 67 this.chart.Series.Clear(); 60 68 if (Content != null) { 69 var trainingRows = Content.ProblemData.TrainingIndices; 70 var testRows = Content.ProblemData.TestIndices; 61 71 this.chart.Series.Add(SIGNALS_SERIES_NAME); 72 this.chart.Series[SIGNALS_SERIES_NAME].YAxisType = AxisType.Secondary; 62 73 this.chart.Series[SIGNALS_SERIES_NAME].LegendText = SIGNALS_SERIES_NAME; 63 74 this.chart.Series[SIGNALS_SERIES_NAME].ChartType = SeriesChartType.FastLine; 64 this.chart.Series[SIGNALS_SERIES_NAME].Points.DataBindY(Content.Signals.ToArray()); 75 this.chart.Series[SIGNALS_SERIES_NAME].Points.DataBindXY( 76 trainingRows.Concat(testRows).ToArray(), 77 Content.TrainingSignals.Concat(Content.TestSignals).ToArray()); 65 78 this.chart.Series[SIGNALS_SERIES_NAME].Tag = Content; 66 79 67 IEnumerable<double> accumulatedPrice = GetAccumulatedPrices(Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceVariable)); 80 var trainingPriceChanges = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceChangeVariable, 81 trainingRows); 82 var testPriceChanges = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceChangeVariable, 83 testRows); 84 IEnumerable<double> accumulatedTrainingPrice = GetAccumulatedProfits(trainingPriceChanges); 85 IEnumerable<double> accumulatedTestPrice = GetAccumulatedProfits(testPriceChanges); 68 86 this.chart.Series.Add(PRICEVARIABLE_SERIES_NAME); 87 this.chart.Series[PRICEVARIABLE_SERIES_NAME].YAxisType = AxisType.Primary; 69 88 this.chart.Series[PRICEVARIABLE_SERIES_NAME].LegendText = PRICEVARIABLE_SERIES_NAME; 70 89 this.chart.Series[PRICEVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine; 71 this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.DataBindY(accumulatedPrice.ToArray()); 90 this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.DataBindXY( 91 trainingRows.Concat(testRows).ToArray(), 92 accumulatedTrainingPrice.Concat(accumulatedTestPrice).ToArray()); 72 93 this.chart.Series[PRICEVARIABLE_SERIES_NAME].Tag = Content; 73 94 74 IEnumerable<double> profit = OnlineProfitCalculator.GetProfits(Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceVariable), Content.Signals, Content.ProblemData.TransactionCosts); 75 IEnumerable<double> accumulatedProfits = GetAccumulatedPrices(profit); 95 96 IEnumerable<double> trainingProfit = OnlineProfitCalculator.GetProfits(trainingPriceChanges, Content.TrainingSignals, Content.ProblemData.TransactionCosts); 97 IEnumerable<double> testProfit = OnlineProfitCalculator.GetProfits(testPriceChanges, Content.TestSignals, Content.ProblemData.TransactionCosts); 98 IEnumerable<double> accTrainingProfit = GetAccumulatedProfits(trainingProfit); 99 IEnumerable<double> accTestProfit = GetAccumulatedProfits(testProfit); 76 100 this.chart.Series.Add(ASSET_SERIES_NAME); 101 this.chart.Series[ASSET_SERIES_NAME].YAxisType = AxisType.Primary; 77 102 this.chart.Series[ASSET_SERIES_NAME].LegendText = ASSET_SERIES_NAME; 78 103 this.chart.Series[ASSET_SERIES_NAME].ChartType = SeriesChartType.FastLine; 79 this.chart.Series[ASSET_SERIES_NAME].Points.DataBindY(accumulatedProfits.ToArray()); 104 this.chart.Series[ASSET_SERIES_NAME].Points.DataBindXY( 105 trainingRows.Concat(testRows).ToArray(), 106 accTrainingProfit.Concat(accTestProfit).ToArray()); 80 107 this.chart.Series[ASSET_SERIES_NAME].Tag = Content; 81 108 … … 84 111 } 85 112 86 private IEnumerable<double> GetAccumulatedPr ices(IEnumerable<double> xs) {113 private IEnumerable<double> GetAccumulatedProfits(IEnumerable<double> xs) { 87 114 double sum = 0; 88 115 foreach (var x in xs) {
Note: See TracChangeset
for help on using the changeset viewer.