Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLab.Problems.DataAnalysis.Trading-3.4.csproj
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLab.Problems.DataAnalysis.Trading-3.4.csproj	(revision 6131)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLab.Problems.DataAnalysis.Trading-3.4.csproj	(revision 6136)
@@ -203,5 +203,7 @@
     <Compile Include="Symbolic\SymbolicTradingModel.cs" />
     <Compile Include="Symbolic\SymbolicTradingSolution.cs" />
-    <Compile Include="Symbolic\Views\SymbolicTradingSolutionView.cs" />
+    <Compile Include="Symbolic\Views\SymbolicTradingSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
     <Compile Include="Symbolic\Views\SymbolicTradingSolutionView.Designer.cs">
       <DependentUpon>SymbolicTradingSolutionView.cs</DependentUpon>
@@ -218,5 +220,7 @@
       <DependentUpon>TradingSolutionLineChartView.cs</DependentUpon>
     </Compile>
-    <Compile Include="Views\TradingSolutionView.cs" />
+    <Compile Include="Views\TradingSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
     <Compile Include="Views\TradingSolutionView.Designer.cs">
       <DependentUpon>TradingSolutionView.cs</DependentUpon>
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionLineChartView.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionLineChartView.cs	(revision 6131)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionLineChartView.cs	(revision 6136)
@@ -24,7 +24,9 @@
 using System.Windows.Forms;
 using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Common;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
+using System.Collections.Generic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
@@ -32,6 +34,7 @@
   [Content(typeof(ITradingSolution))]
   public partial class TradingSolutionLineChartView : ItemView, ITradingSolutionEvaluationView {
-    private const string PRICEVARIABLE_SERIES_NAME = "PriceVariable";
+    private const string PRICEVARIABLE_SERIES_NAME = "Price";
     private const string SIGNALS_SERIES_NAME = "Signals";
+    private const string ASSET_SERIES_NAME = "Asset";
 
     public new ITradingSolution Content {
@@ -57,29 +60,87 @@
       this.chart.Series.Clear();
       if (Content != null) {
-        this.chart.Series.Add(PRICEVARIABLE_SERIES_NAME);
-        this.chart.Series[PRICEVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.PriceVariable;
-        this.chart.Series[PRICEVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
-        this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.PriceVariable));
-        this.UpdateStripLines();
+        //this.chart.Series.Add(PRICEVARIABLE_SERIES_NAME);
+        //this.chart.Series[PRICEVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.PriceVariable;
+        //this.chart.Series[PRICEVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
+        //this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.PriceVariable));
+
 
         this.chart.Series.Add(SIGNALS_SERIES_NAME);
-        this.chart.Series[SIGNALS_SERIES_NAME].LegendText = Content.ItemName;
+        this.chart.Series[SIGNALS_SERIES_NAME].LegendText = SIGNALS_SERIES_NAME;
         this.chart.Series[SIGNALS_SERIES_NAME].ChartType = SeriesChartType.FastLine;
         this.chart.Series[SIGNALS_SERIES_NAME].Points.DataBindY(Content.Signals.ToArray());
         this.chart.Series[SIGNALS_SERIES_NAME].Tag = Content;
-        UpdateCursorInterval();
-      }
-    }
-
-    private void UpdateCursorInterval() {
-      var estimatedValues = this.chart.Series[SIGNALS_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
-      var targetValues = this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
-      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
-      double targetValuesRange = targetValues.Max() - targetValues.Min();
-      double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
-      double digits = (int)Math.Log10(interestingValuesRange) - 3;
-      double yZoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
-      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
-    }
+
+        IEnumerable<double> accumulatedPrice = GetAccumulatedPrices(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.PriceVariable));
+        this.chart.Series.Add(PRICEVARIABLE_SERIES_NAME);
+        this.chart.Series[PRICEVARIABLE_SERIES_NAME].LegendText = PRICEVARIABLE_SERIES_NAME;
+        this.chart.Series[PRICEVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
+        this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.DataBindY(accumulatedPrice.ToArray());
+        this.chart.Series[PRICEVARIABLE_SERIES_NAME].Tag = Content;
+
+        IEnumerable<double> profit = GetProfits(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.PriceVariable), Content.Signals, Content.ProblemData.TransactionCosts);
+        IEnumerable<double> accumulatedProfits = GetAccumulatedPrices(profit);
+        this.chart.Series.Add(ASSET_SERIES_NAME);
+        this.chart.Series[ASSET_SERIES_NAME].LegendText = ASSET_SERIES_NAME;
+        this.chart.Series[ASSET_SERIES_NAME].ChartType = SeriesChartType.FastLine;
+        this.chart.Series[ASSET_SERIES_NAME].Points.DataBindY(accumulatedProfits.ToArray());
+        this.chart.Series[ASSET_SERIES_NAME].Tag = Content;
+
+        this.UpdateStripLines();
+
+        // UpdateCursorInterval();
+      }
+    }
+
+    private IEnumerable<double> GetProfits(IEnumerable<double> returns, IEnumerable<double> signals, double transactionCost) {
+      double p = 0;
+      double iterationReturn = 0.0;
+      foreach (var signalReturn in returns.Zip(signals, (r, s) => new { Return = r, Signal = s })) {
+        double signal = signalReturn.Signal;
+        double actualReturn = signalReturn.Return;
+        if (p == 0 && signal.IsAlmost(0)) {
+        } else if (p == 0 && signal.IsAlmost(1)) {
+          p = 1;
+        } else if (p == 0 && signal.IsAlmost(-1)) {
+          p = -1;
+        } else if (p == 1 && signal.IsAlmost(1)) {
+          iterationReturn = actualReturn;
+        } else if (p == 1 && signal.IsAlmost(0)) {
+          iterationReturn = actualReturn - transactionCost;
+          p = 0;
+        } else if (p == 1 && signal.IsAlmost(-1)) {
+          iterationReturn = actualReturn - transactionCost;
+          p = -1;
+        } else if (p == -1 && signal.IsAlmost(-1)) {
+          iterationReturn = -actualReturn;
+        } else if (p == -1 && signal.IsAlmost(0)) {
+          iterationReturn = -actualReturn - transactionCost;
+          p = 0;
+        } else if (p == -1 && signal.IsAlmost(1)) {
+          iterationReturn = -actualReturn - transactionCost;
+          p = -1;
+        }
+        yield return iterationReturn;
+      }
+    }
+
+    private IEnumerable<double> GetAccumulatedPrices(IEnumerable<double> xs) {
+      double sum = 0;
+      foreach (var x in xs) {
+        sum += x;
+        yield return sum;
+      }
+    }
+
+    //private void UpdateCursorInterval() {
+    //  var estimatedValues = this.chart.Series[SIGNALS_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
+    //  var targetValues = this.chart.Series[PRICEVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
+    //  double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
+    //  double targetValuesRange = targetValues.Max() - targetValues.Min();
+    //  double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
+    //  double digits = (int)Math.Log10(interestingValuesRange) - 3;
+    //  double yZoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
+    //  this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
+    //}
 
     #region events
@@ -100,5 +161,5 @@
 
     private void Content_ModelChanged(object sender, EventArgs e) {
-      UpdateEstimatedValuesLineChart();
+      RedrawChart();
     }
 
@@ -106,19 +167,4 @@
       base.OnContentChanged();
       RedrawChart();
-    }
-
-    private void UpdateEstimatedValuesLineChart() {
-      if (InvokeRequired) Invoke((Action)UpdateEstimatedValuesLineChart);
-      else {
-        if (this.chart.Series.Count > 0) {
-          Series s = this.chart.Series.SingleOrDefault(x => x.Tag == Content);
-          if (s != null) {
-            s.Points.DataBindY(Content.Signals.ToArray());
-            s.LegendText = Content.ItemName;
-            this.UpdateStripLines();
-            UpdateCursorInterval();
-          }
-        }
-      }
     }
 
