Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/CSVInstanceProvider.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/CSVInstanceProvider.cs	(revision 9176)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/CSVInstanceProvider.cs	(revision 9176)
@@ -0,0 +1,130 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.Instances;
+using HeuristicLab.Problems.Instances.DataAnalysis;
+
+namespace HeuristicLab.Problems.DataAnalysis.Trading {
+  public class CSVInstanceProvider : IProblemInstanceProvider<ITradingProblemData> {
+    public string Name {
+      get { return "CSV File"; }
+    }
+    public string Description {
+      get {
+        return "";
+      }
+    }
+    public Uri WebLink {
+      get { return new Uri("http://dev.heuristiclab.com/trac/hl/core/wiki/UsersFAQ#DataAnalysisImportFileFormat"); }
+    }
+    public string ReferencePublication {
+      get { return ""; }
+    }
+
+    public IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      return new List<IDataDescriptor>();
+    }
+    public ITradingProblemData LoadData(IDataDescriptor descriptor) {
+      throw new NotImplementedException();
+    }
+
+    public bool CanImportData {
+      get { return true; }
+    }
+    public ITradingProblemData ImportData(string path) {
+      TableFileParser csvFileParser = new TableFileParser();
+      csvFileParser.Parse(path);
+
+      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+      string targetVar = dataset.DoubleVariables.Last();
+
+      // turn of input variables that are constant in the training partition
+      var allowedInputVars = new List<string>();
+      var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3);
+      if (trainingIndizes.Count() >= 2) {
+        foreach (var variableName in dataset.DoubleVariables) {
+          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
+            variableName != targetVar)
+            allowedInputVars.Add(variableName);
+        }
+      } else {
+        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
+      }
+
+      ITradingProblemData regressionData = new TradingProblemData(dataset, allowedInputVars, targetVar);
+
+      var trainingPartEnd = trainingIndizes.Last();
+      regressionData.TrainingPartition.Start = trainingIndizes.First();
+      regressionData.TrainingPartition.End = trainingPartEnd;
+      regressionData.TestPartition.Start = trainingPartEnd;
+      regressionData.TestPartition.End = csvFileParser.Rows;
+
+      regressionData.Name = Path.GetFileName(path);
+
+      return regressionData;
+    }
+
+    protected ITradingProblemData ImportData(string path, RegressionImportType type, TableFileParser csvFileParser) {
+      List<IList> values = csvFileParser.Values;
+      Dataset dataset = new Dataset(csvFileParser.VariableNames, values);
+
+      // turn of input variables that are constant in the training partition
+      var allowedInputVars = new List<string>();
+      int trainingPartEnd = (csvFileParser.Rows * type.TrainingPercentage) / 100;
+      trainingPartEnd = trainingPartEnd > 0 ? trainingPartEnd : 1;
+      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
+      if (trainingIndizes.Count() >= 2) {
+        foreach (var variableName in dataset.DoubleVariables) {
+          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
+            variableName != type.TargetVariable)
+            allowedInputVars.Add(variableName);
+        }
+      } else {
+        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable)));
+      }
+
+      ITradingProblemData regressionData = new TradingProblemData(dataset, allowedInputVars, type.TargetVariable);
+
+      regressionData.TrainingPartition.Start = 0;
+      regressionData.TrainingPartition.End = trainingPartEnd;
+      regressionData.TestPartition.Start = trainingPartEnd;
+      regressionData.TestPartition.End = csvFileParser.Rows;
+
+      regressionData.Name = Path.GetFileName(path);
+
+      return regressionData;
+    }
+    public bool CanExportData {
+      get { return false; }
+    }
+
+    public void ExportData(ITradingProblemData instance, string path) {
+      throw new NotImplementedException();
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineProfitCalculator.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineProfitCalculator.cs	(revision 9176)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineProfitCalculator.cs	(revision 9176)
@@ -0,0 +1,111 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class OnlineProfitCalculator : IOnlineCalculator {
+
+    private int p;
+    private double transactionCost;
+    private int c;
+    private double sum;
+    public double Profit {
+      get { return sum; }
+    }
+
+    public OnlineProfitCalculator(double transactionCost) {
+      this.transactionCost = transactionCost;
+      Reset();
+    }
+
+    #region IOnlineCalculator Members
+    public OnlineCalculatorError ErrorState {
+      get { return OnlineCalculatorError.None; }
+    }
+    public double Value {
+      get { return Profit; }
+    }
+    public void Reset() {
+      p = 0;
+      c = 0;
+      sum = 0.0;
+    }
+
+    public void Add(double actualReturn, double signal) {
+      double iterationReturn = 0.0;
+      if (c == 0) {
+        p = (int)signal;
+        iterationReturn = 0;
+        c++;
+      } else {
+        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;
+        }
+        c++;
+      }
+      sum += iterationReturn;
+    }
+    #endregion
+
+    public static double Calculate(IEnumerable<double> returns, IEnumerable<double> signals, double transactionCost, out OnlineCalculatorError errorState) {
+      IEnumerator<double> returnsEnumerator = returns.GetEnumerator();
+      IEnumerator<double> signalsEnumerator = signals.GetEnumerator();
+      OnlineProfitCalculator calculator = new OnlineProfitCalculator(transactionCost);
+
+      // always move forward both enumerators (do not use short-circuit evaluation!)
+      while (returnsEnumerator.MoveNext() & signalsEnumerator.MoveNext()) {
+        double signal = signalsEnumerator.Current;
+        double @return = returnsEnumerator.Current;
+        calculator.Add(@return, signal);
+      }
+
+      // check if both enumerators are at the end to make sure both enumerations have the same length
+      if (returnsEnumerator.MoveNext() || signalsEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in first and second enumeration doesn't match.");
+      } else {
+        errorState = calculator.ErrorState;
+        return calculator.Profit;
+      }
+    }
+  }
+}
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineSharpeRatioCalculator.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineSharpeRatioCalculator.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Calculators/OnlineSharpeRatioCalculator.cs	(revision 9176)
@@ -83,8 +83,8 @@
           iterationReturn = -actualReturn;
         } else if (p == -1 && signal.IsAlmost(0)) {
-          iterationReturn = -(actualReturn - transactionCost);
+          iterationReturn = -actualReturn - transactionCost;
           p = 0;
         } else if (p == -1 && signal.IsAlmost(1)) {
-          iterationReturn = -(actualReturn - transactionCost);
+          iterationReturn = -actualReturn - transactionCost;
           p = 1;
         }
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 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLab.Problems.DataAnalysis.Trading-3.4.csproj	(revision 9176)
@@ -41,5 +41,5 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -58,5 +58,5 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x64\Debug\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
@@ -76,5 +76,5 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x86\Debug\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
@@ -93,6 +93,7 @@
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ALGLIB-3.1.0">
-      <HintPath>c:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath>
+    <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.Analysis-3.3">
@@ -161,4 +162,10 @@
     <Reference Include="HeuristicLab.Problems.DataAnalysis.Views-3.4">
       <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.DataAnalysis.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.Random-3.3">
@@ -185,4 +192,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Calculators\OnlineProfitCalculator.cs" />
     <Compile Include="HeuristicLabProblemsDataAnalysisTradingPlugin.cs" />
     <Compile Include="Interfaces\ITradingEnsembleModel.cs" />
@@ -192,4 +200,5 @@
     <Compile Include="Interfaces\ITradingSolution.cs" />
     <Compile Include="Calculators\OnlineSharpeRatioCalculator.cs" />
+    <Compile Include="CSVInstanceProvider.cs" />
     <Compile Include="Symbolic\Interfaces\ISymbolicTradingEvaluator.cs" />
     <Compile Include="Symbolic\Interfaces\ISymbolicTradingModel.cs" />
@@ -228,6 +237,6 @@
     <None Include="HeuristicLab.snk" />
     <None Include="HeuristicLabProblemsDataAnalysisTradingPlugin.cs.frame" />
-    <None Include="Properties\AssemblyInfo.frame" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
   </ItemGroup>
   <ItemGroup>
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLabProblemsDataAnalysisTradingPlugin.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLabProblemsDataAnalysisTradingPlugin.cs.frame	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLabProblemsDataAnalysisTradingPlugin.cs.frame	(revision 9176)
@@ -28,5 +28,5 @@
   [Plugin("HeuristicLab.Problems.DataAnalysis.Trading","Provides classes to optimize trading rules (single- or multiobjective).", "3.4.0.$WCREV$")]
   [PluginFile("HeuristicLab.Problems.DataAnalysis.Trading-3.4.dll", PluginFileType.Assembly)]
-  [PluginDependency("HeuristicLab.ALGLIB", "3.1")]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.6")]
   [PluginDependency("HeuristicLab.Analysis", "3.3")]
   [PluginDependency("HeuristicLab.Common", "3.3")]
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Properties/AssemblyInfo.cs.frame	(revision 9176)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Properties/AssemblyInfo.cs.frame	(revision 9176)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Trading")]
+[assembly: AssemblyDescription("Provides classes to optimize trading rules.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2011 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("BB953FDE-86BA-48A2-A684-5CD3A9BB3E31")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.0.$WCREV$")]
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Properties/AssemblyInfo.frame
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Properties/AssemblyInfo.frame	(revision 6937)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Trading")]
-[assembly: AssemblyDescription("Provides classes to optimize trading rules.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("HeuristicLab")]
-[assembly: AssemblyCopyright("(c) 2002-2011 HEAL")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("BB953FDE-86BA-48A2-A684-5CD3A9BB3E31")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers 
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("3.4.0.0")]
-[assembly: AssemblyFileVersion("3.4.0.$WCREV$")]
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveProblem.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveProblem.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveProblem.cs	(revision 9176)
@@ -58,8 +58,8 @@
     }
 
-    public override void ImportProblemDataFromFile(string fileName) {
-      TradingProblemData problemData = TradingProblemData.ImportFromFile(fileName);
-      ProblemData = problemData;
-    }
+    //public override void ImportProblemDataFromFile(string fileName) {
+    //  TradingProblemData problemData = TradingProblemData.ImportFromFile(fileName);
+    //  ProblemData = problemData;
+    //}
   }
 }
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveSharpeRatioEvaluator.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveSharpeRatioEvaluator.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SymbolicTradingSingleObjectiveSharpeRatioEvaluator.cs	(revision 9176)
@@ -60,5 +60,5 @@
     public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, ITradingProblemData problemData, IEnumerable<int> rows) {
       IEnumerable<double> signals = GetSignals(interpreter, solution, problemData.Dataset, rows);
-      IEnumerable<double> returns = problemData.Dataset.GetEnumeratedVariableValues(problemData.PriceVariable, rows);
+      IEnumerable<double> returns = problemData.Dataset.GetDoubleValues(problemData.PriceVariable, rows);
       OnlineCalculatorError errorState;
       double sharpRatio = OnlineSharpeRatioCalculator.Calculate(returns, signals, problemData.TransactionCosts, out errorState);
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SymbolicTradingSolution.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SymbolicTradingSolution.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SymbolicTradingSolution.cs	(revision 9176)
@@ -70,6 +70,6 @@
     }
 
-    protected override void OnModelChanged(EventArgs e) {
-      base.OnModelChanged(e);
+    protected override void OnModelChanged() {
+      base.OnModelChanged();
       RecalculateResults();
     }
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblem.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblem.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblem.cs	(revision 9176)
@@ -23,4 +23,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
 
 namespace HeuristicLab.Problems.DataAnalysis {
@@ -39,9 +40,4 @@
       ProblemData = new TradingProblemData();
     }
-
-    public override void ImportProblemDataFromFile(string fileName) {
-      TradingProblemData problemData = TradingProblemData.ImportFromFile(fileName);
-      ProblemData = problemData;
-    }
   }
 }
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblemData.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblemData.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingProblemData.cs	(revision 9176)
@@ -29,4 +29,6 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+using HeuristicLab.Problems.Instances.DataAnalysis;
 
 namespace HeuristicLab.Problems.DataAnalysis {
@@ -1648,17 +1650,20 @@
     }
 
-    #region Import from file
-    public static TradingProblemData ImportFromFile(string fileName) {
-      TableFileParser csvFileParser = new TableFileParser();
-      csvFileParser.Parse(fileName);
+    
 
-      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
-      dataset.Name = Path.GetFileName(fileName);
 
-      TradingProblemData problemData = new TradingProblemData(dataset, dataset.VariableNames.Skip(1), dataset.VariableNames.First());
-      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
-      return problemData;
-    }
-    #endregion
+    //#region Import from file
+    //public static TradingProblemData ImportFromFile(string fileName) {
+    //  TableFileParser csvFileParser = new TableFileParser();
+    //  csvFileParser.Parse(fileName);
+
+    //  Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+    //  dataset.Name = Path.GetFileName(fileName);
+
+    //  TradingProblemData problemData = new TradingProblemData(dataset, dataset.VariableNames.Skip(1), dataset.VariableNames.First());
+    //  problemData.Name = "Data imported from " + Path.GetFileName(fileName);
+    //  return problemData;
+    //}
+    //#endregion
   }
 }
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingSolution.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingSolution.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/TradingSolution.cs	(revision 9176)
@@ -36,4 +36,6 @@
     private const string TrainingSharpeRatioResultName = "Sharpe ratio (training)";
     private const string TestSharpeRatioResultName = "Sharpe ratio (test)";
+    private const string TrainingProfitResultName = "Profit (training)";
+    private const string TestProfitResultName = "Profit (test)";
 
     public new ITradingModel Model {
@@ -56,4 +58,13 @@
       private set { ((DoubleValue)this[TestSharpeRatioResultName].Value).Value = value; }
     }
+    public double TrainingProfit {
+      get { return ((DoubleValue)this[TrainingProfitResultName].Value).Value; }
+      private set { ((DoubleValue)this[TrainingProfitResultName].Value).Value = value; }
+    }
+
+    public double TestProfit {
+      get { return ((DoubleValue)this[TestProfitResultName].Value).Value; }
+      private set { ((DoubleValue)this[TestProfitResultName].Value).Value = value; }
+    }
 
     [StorableConstructor]
@@ -66,14 +77,18 @@
       Add(new Result(TrainingSharpeRatioResultName, "Share ratio of the signals of the model on the training partition", new DoubleValue()));
       Add(new Result(TestSharpeRatioResultName, "Sharpe ratio of the signals of the model on the test partition", new DoubleValue()));
+      Add(new Result(TrainingProfitResultName, "Profit of the model on the training partition", new DoubleValue()));
+      Add(new Result(TestProfitResultName, "Profit of the model on the test partition", new DoubleValue()));
 
       RecalculateResults();
     }
 
-    protected override void OnProblemDataChanged(EventArgs e) {
-      base.OnProblemDataChanged(e);
+
+    protected override void OnModelChanged() {
+      base.OnModelChanged();
       RecalculateResults();
     }
-    protected override void OnModelChanged(EventArgs e) {
-      base.OnModelChanged(e);
+
+    protected override void OnProblemDataChanged() {
+      base.OnProblemDataChanged();
       RecalculateResults();
     }
@@ -81,8 +96,8 @@
     protected override void RecalculateResults() {
       double[] trainingSignals = TrainingSignals.ToArray(); // cache values
-      IEnumerable<double> trainingReturns = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.PriceVariable, ProblemData.TrainingIndizes);
+      IEnumerable<double> trainingReturns = ProblemData.Dataset.GetDoubleValues(ProblemData.PriceVariable, ProblemData.TrainingIndices);
       double[] testSignals = TestSignals.ToArray(); // cache values
-      IEnumerable<double> testReturns = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.PriceVariable, ProblemData.TestIndizes);
-    
+      IEnumerable<double> testReturns = ProblemData.Dataset.GetDoubleValues(ProblemData.PriceVariable, ProblemData.TestIndices);
+
       OnlineCalculatorError errorState;
       double trainingSharpeRatio = OnlineSharpeRatioCalculator.Calculate(trainingReturns, trainingSignals, ProblemData.TransactionCosts, out errorState);
@@ -90,4 +105,9 @@
       double testSharpeRatio = OnlineSharpeRatioCalculator.Calculate(testReturns, testSignals, ProblemData.TransactionCosts, out errorState);
       TestSharpeRatio = errorState == OnlineCalculatorError.None ? testSharpeRatio : double.NaN;
+
+      double trainingProfit = OnlineProfitCalculator.Calculate(trainingReturns, trainingSignals, ProblemData.TransactionCosts, out errorState);
+      TrainingProfit = errorState == OnlineCalculatorError.None ? trainingProfit : double.NaN;
+      double testProfit = OnlineProfitCalculator.Calculate(testReturns, testSignals, ProblemData.TransactionCosts, out errorState);
+      TestProfit = errorState == OnlineCalculatorError.None ? testProfit : double.NaN;
 
     }
@@ -101,5 +121,5 @@
     public virtual IEnumerable<double> TrainingSignals {
       get {
-        return GetSignals(ProblemData.TrainingIndizes);
+        return GetSignals(ProblemData.TrainingIndices);
       }
     }
@@ -107,5 +127,5 @@
     public virtual IEnumerable<double> TestSignals {
       get {
-        return GetSignals(ProblemData.TestIndizes);
+        return GetSignals(ProblemData.TestIndices);
       }
     }
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 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionLineChartView.cs	(revision 9176)
@@ -33,8 +33,9 @@
   [View("Line Chart")]
   [Content(typeof(ITradingSolution))]
-  public partial class TradingSolutionLineChartView : ItemView, ITradingSolutionEvaluationView {
+  public partial class TradingSolutionLineChartView : DataAnalysisSolutionEvaluationView, ITradingSolutionEvaluationView {
     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 {
@@ -72,5 +73,5 @@
         this.chart.Series[SIGNALS_SERIES_NAME].Tag = Content;
 
-        IEnumerable<double> accumulatedPrice = GetAccumulatedPrices(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.PriceVariable));
+        IEnumerable<double> accumulatedPrice = GetAccumulatedPrices(Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceVariable));
         this.chart.Series.Add(PRICEVARIABLE_SERIES_NAME);
         this.chart.Series[PRICEVARIABLE_SERIES_NAME].LegendText = PRICEVARIABLE_SERIES_NAME;
@@ -79,5 +80,5 @@
         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> profit = GetProfits(Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.PriceVariable), Content.Signals, Content.ProblemData.TransactionCosts);
         IEnumerable<double> accumulatedProfits = GetAccumulatedPrices(profit);
         this.chart.Series.Add(ASSET_SERIES_NAME);
@@ -94,5 +95,5 @@
 
     private IEnumerable<double> GetProfits(IEnumerable<double> returns, IEnumerable<double> signals, double transactionCost) {
-      double p = signals.First();
+      int p = (int)signals.First();
       yield return 0.0;
       foreach (var signalReturn in returns.Skip(1).Zip(signals.Skip(1), (r, s) => new { Return = r, Signal = s })) {
@@ -118,8 +119,8 @@
           iterationReturn = -actualReturn;
         } else if (p == -1 && signal.IsAlmost(0)) {
-          iterationReturn = -(actualReturn - transactionCost);
+          iterationReturn = -actualReturn - transactionCost;
           p = 0;
         } else if (p == -1 && signal.IsAlmost(1)) {
-          iterationReturn = -(actualReturn - transactionCost);
+          iterationReturn = -actualReturn - transactionCost;
           p = 1;
         }
Index: branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionView.cs
===================================================================
--- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionView.cs	(revision 6937)
+++ branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/TradingSolutionView.cs	(revision 9176)
@@ -34,5 +34,5 @@
       var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(ITradingSolutionEvaluationView), true);
       foreach (Type viewType in regressionSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
     }
 
