Index: branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/EvaluatorTradeRules.cs
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/EvaluatorTradeRules.cs	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/EvaluatorTradeRules.cs	(revision 9386)
@@ -44,6 +44,4 @@
             double quality = Calculate((ITradeRulesExpresionTree) SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
             QualityParameter.ActualValue = new DoubleValue(quality);
-            ITradeRulesExpresionTree interpreter = (ITradeRulesExpresionTree)SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
-            interpreter.clearVariables();
             return base.Apply();
         }
@@ -52,9 +50,9 @@
         {
             interpreter.setInitialTraining(initialTraining);
-            interpreter.setInitialTest(initialTest);
+            interpreter.setInitialTest(rows.ToArray()[0]);
             IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
+            interpreter.clearVariables();
+            double tradingCash = OnlineTradeRulesCalculator.Calculate(estimatedValues, problemData, rows);
             
-            double tradingCash = OnlineTradeRulesCalculator.Calculate(estimatedValues, problemData, problemData.TrainingIndices);
-
             return tradingCash;
         }
@@ -69,5 +67,4 @@
             EstimationLimitsParameter.ExecutionContext = null;
          
-
             return r2;
         }
Index: branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/OnlineTradeRulesCalculator.cs
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/OnlineTradeRulesCalculator.cs	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/Evaluator/OnlineTradeRulesCalculator.cs	(revision 9386)
@@ -4,4 +4,7 @@
 using System.Text;
 using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 
 namespace HeuristicLab.Problems.TradeRules
@@ -9,46 +12,63 @@
     class OnlineTradeRulesCalculator
     {
+        private static int numberTrades;
+        private static int tradeDays;
+        private static int totalTradeDays;
+
         public static double Calculate(IEnumerable<double> estimatedValues, IRegressionProblemData problemData, IEnumerable<int> rows)
-        {/*
-            const double commission = 0.25;
-            const double EAR = 4.00;  //Effective Anual Rate 
+        {
+            double[] arrayOpen = problemData.Dataset.GetDoubleValues("\"Open\"").ToArray(); //Array with all Open prices
+            int[] tick = rows.ToArray();
+            double[] arrayIO = estimatedValues.ToArray();
+            double[] arrayDate = problemData.Dataset.GetDoubleValues("\"Date\"").ToArray(); //Array with all dates
+           
+            const double COMISSION = 0.25;
+            const double EAR = 5.00;  //Effective Anual Rate
+            const double CASHINI = 10000.00;
+            int tickIni = tick[0];
+            int tickEnd = tick[tick.Length-1];
+            const double DAYSYEAR = 365.00;
 
-            double DayRat = 0; //One day interest
+            double DayRat = 0.0; //One day interest
             double interest = 0.0; // Interest for one day
-            double[] arrayDate = problemData.Dataset.GetDoubleValues("\"Date\"").ToArray(); //Array with all dates in UNIX format
+            int nDias1 = 0;
+            int nDias2 = 0;
+            int dayBefore=0;
+            int yesterday=0;
 
-            //int count = rows.ToList()[0];
- 
+            int actualRow = 0;
+            int nData = tick.Length;
+
             bool intoMarket = false;//Equivalent to be into the market
-            int totalTradeDays = 0;
-            int numberTrades = 0;
-            int tradeDays = 0;
-            double dayBefore = 0.0;
-            double yesterday = 0.0;
+            numberTrades = 0;
+            tradeDays = 0;
+            totalTradeDays = 0;
             double buyPrice = 0.0;
             double sellPrice = 0.0;
-            string stringPrice = "";
             int nShares = 0;
-            double cash = 10000.00;
+
+            double cash = CASHINI;
             double expend = 0.0;
-            double equity = 0.0;
-            double profit1 = 0.0;
+            double profitTrade = 0.0;
             double charged = 0.0;
 
-            IEnumerator<int> initialRow = rows.GetEnumerator();
-            initialRow.MoveNext();
-            int numDays1 = (int)arrayDate[initialRow.Current-1];
-            int numDays2 = (int) arrayDate[(initialRow.Current)];
-            int count = initialRow.Current + 1;
-            
-            IEnumerator<double> enumerator = estimatedValues.GetEnumerator();
-            enumerator.MoveNext();
-            dayBefore = enumerator.Current;
-            enumerator.MoveNext();
-            yesterday = enumerator.Current;
+            double [] equity = new double [nData];
+            DayRat = DAYSYEAR * (Math.Pow((1.0 + (EAR/100)), (1.0/ DAYSYEAR)) - 1.0);
 
-            DayRat = 360 * (Math.Pow((1 + (EAR / 100)), (1 / 360)) - 1);
+            //First Day
+            equity[0] = CASHINI;
+            actualRow++;
+            nDias2 = Convert.ToInt32(arrayDate[tick[1]] - arrayDate[tick[0]]);
+            //Second day in the marquet. -----------------------------------------
+            cash = CASHINI * Math.Pow((1.0 + DayRat / DAYSYEAR), nDias2);
+            equity[1] = cash;
+            nDias2 = Convert.ToInt32(arrayDate[tick[2]] - arrayDate[tick[1]]);
+            interest = cash * Math.Pow((1.0 + DayRat / DAYSYEAR), nDias2) - cash;
+            dayBefore = Convert.ToInt32(arrayIO[0]);
+            yesterday = Convert.ToInt32(arrayIO[1]);
+            //Earnings computation -----------------------------------------------
+            actualRow = 2;
 
-            while (enumerator.MoveNext())
+            while (actualRow<(nData-1))
             {
                 if (!intoMarket)
@@ -57,123 +77,15 @@
                     {
                         intoMarket = true;
-                        stringPrice = problemData.Dataset.GetValue(count, 0); //Extracting Open values
-                        buyPrice = Convert.ToDouble(stringPrice);
-                        totalTradeDays++; numberTrades++; tradeDays++; //Increasing trading variables
-                        nShares = (int)Math.Floor(cash / (buyPrice * (1.0 + commission / 100)));
-                        expend = buyPrice * nShares * (1 + commission / 100);
-                        cash = cash - expend + interest;
-                        equity = cash + nShares * buyPrice * (1 - commission / 100);
-                        interest = cash * Math.Pow((1 + DayRat / 360), numDays2) - cash;
+                        buyPrice = arrayOpen[tick[actualRow]];
+                        totalTradeDays++; numberTrades++; tradeDays=1; //Increasing trading variables
+                        nShares = Convert.ToInt32(Math.Floor(cash / (buyPrice * (1.0 + COMISSION / 100))));
+                        expend = buyPrice * nShares * (1.0 + COMISSION / 100);
+                        cash = cash + interest - expend;
+                        equity[actualRow] = cash + nShares * (buyPrice * (1.0 - COMISSION / 100));
                     }
                     else  //Dia normal fuera del mercado
                     {
                         cash = cash + interest;
-                        equity = equity + cash;
-                        interest = cash * Math.Pow((1 + DayRat / 360), numDays2) - cash;
-                    }
-
-                }
-                else if (dayBefore == 1 && yesterday == -1)
-                {
-                    intoMarket = false;
-                    stringPrice = problemData.Dataset.GetValue(count, 0); //Extracting Open values
-                    sellPrice = Convert.ToDouble(stringPrice);
-                    profit1 += sellPrice - buyPrice;
-                    charged = sellPrice * nShares * (1 - commission / 100);
-                    cash = cash + charged + interest;
-                    equity = cash;
-                    interest = cash * Math.Pow((1 + DayRat / 360), numDays2) - cash;
-                    nShares = 0;
-                }
-                else
-                {
-                    cash = cash + interest;
-                    tradeDays += numDays1;
-                    totalTradeDays += numDays1;
-                    equity = cash + nShares * Convert.ToDouble(problemData.Dataset.GetValue(count, 0)) * (1 - commission / 100);
-                    interest = cash * Math.Pow((1 + DayRat / 360), numDays2) - cash;
-                }
-
-                dayBefore = yesterday;
-                yesterday = enumerator.Current;
-                numDays1 = numDays2;
-                numDays2 = (int) arrayDate[count];
-                count++;
-            }
-            if (intoMarket)
-            {
-                intoMarket = false;
-                stringPrice = problemData.Dataset.GetValue(count, 0); //Extracting Open values
-                sellPrice = Convert.ToDouble(stringPrice);
-                profit1 += sellPrice - buyPrice;
-                charged = sellPrice * nShares * (1 - commission / 100);
-                cash = cash + charged + interest;
-                equity = cash;
-                nShares = 0;
-            }
-            return numDays1;*/
-
-            const double commission = 0.25;
-            const double EAR = 4.00;  //Effective Anual Rate 
-
-            double DayRat = 0; //One day interest
-            double interest = 0.0; // Interest for one day
-            double[] arrayDate = problemData.Dataset.GetDoubleValues("\"Date\"").ToArray(); //Array with all dates in UNIX format
-            int nDias1 = 0;
-            int nDias2 = 0;
-
-
-            bool intoMarket = false;//Equivalent to be into the market
-            int totalTradeDays = 0;
-            int numberTrades = 0;
-            int tradeDays = 0;
-            double buyPrice = 0.0;
-            double sellPrice = 0.0;
-            string stringPrice = "";
-            int nShares = 0;
-            double cash = 10000.00;
-            double expend = 0.0;
-            double equity = 0.0;
-            double profit1 = 0.0;
-            double charged = 0.0;
-
-            //SECOND EVALUATOR
-            var enumerator = estimatedValues.GetEnumerator();
-            int count = rows.ToList()[2];
-            int count2 = 2;
-            int date1 = (int)arrayDate[rows.ToList()[0]];
-            int date2 = (int)arrayDate[rows.ToList()[1]];
-
-            enumerator.MoveNext();
-            double dayBefore = enumerator.Current;
-            enumerator.MoveNext();
-            double yesterday = enumerator.Current;
-            
-            DayRat = 268 * (Math.Pow((1 + (EAR / 100)),(1 / 268)) - 1);
-            nDias2 = date2 - date1;
-            
-            while (enumerator.MoveNext())
-            {
-                if (!intoMarket)
-                {
-                    if (dayBefore == -1 && yesterday == 1)
-                    {
-                        intoMarket = true;
-                        stringPrice = problemData.Dataset.GetValue(count, 1); //Extracting Open values
-                        buyPrice = Convert.ToDouble(stringPrice);
-                        totalTradeDays++; numberTrades++; tradeDays++; //Increasing trading variables
-                        nShares = (int)Math.Floor(cash / (buyPrice * (1.0 + commission / 100)));
-                        expend = buyPrice * nShares * (1 + commission / 100);
-                        cash = cash - expend + interest;
-                        equity = cash + nShares * buyPrice * (1 - commission / 100);
-                        interest = cash * Math.Pow((1 + DayRat / 268), nDias2) - cash;
-                    }
-                    else  //Dia normal fuera del mercado
-                    {
-                        tradeDays++;
-                        totalTradeDays++;
-                        cash = cash + interest;
-                        equity = equity+cash;
-                        interest = cash * Math.Pow((1 + DayRat / 268), nDias2) - cash;
+                        equity[actualRow] = cash;
                     }
                 }
@@ -181,47 +93,63 @@
                 {
                     intoMarket = false;
-                    stringPrice = problemData.Dataset.GetValue(count, 1); //Extracting Open values
-                    sellPrice = Convert.ToDouble(stringPrice);
-                    profit1 += sellPrice - buyPrice;
-                    charged = sellPrice * nShares * (1 - commission / 100);
-                    cash = cash + charged+interest;
-                    equity = cash;
-                    interest = cash + Math.Pow((1 + DayRat / 268), nDias2) - cash;
+                    sellPrice = Convert.ToDouble(arrayOpen[tick[actualRow]]);
+                    profitTrade = profitTrade + sellPrice - buyPrice;
+                    charged = nShares * sellPrice * (1.0 - COMISSION / 100);
+                    cash = cash + interest + charged;
+                    equity[actualRow] = cash;
                     nShares = 0;
+                    totalTradeDays = totalTradeDays + nDias1 - 1;
+                    tradeDays = tradeDays + nDias1 - 1;
+                    tradeDays = 0;
                 }
                 else
                 {
+                    totalTradeDays = totalTradeDays + nDias1;
+                    tradeDays = tradeDays + nDias1;
                     cash = cash + interest;
-                    tradeDays++;
-                    totalTradeDays++;
-                    equity = cash + nShares * Convert.ToDouble(problemData.Dataset.GetValue(count,1)) * (1 - commission / 100);
-                    interest = cash * Math.Pow((1 + DayRat / 268), nDias2) - cash;
+                    equity[actualRow] = cash + nShares * arrayOpen[tick[actualRow]] * (1.0 - COMISSION / 100);
+                    
                 }
 
-                dayBefore = yesterday;
-                yesterday = enumerator.Current;
-                date1 = date2;
-                date2 = (int)arrayDate[rows.ToList()[count2]];
-                
-                int nDiasAux = nDias1;
+                nDias2 = Convert.ToInt32(arrayDate[tick[(actualRow + 1)]] - arrayDate[tick[actualRow]]);
+                interest = cash * Math.Pow((1.0 + DayRat / DAYSYEAR), nDias2) - cash;
+                actualRow++;
                 nDias1 = nDias2;
-                nDias2 = date2-date1;
-
-                count++;
-                count2++;
+                dayBefore = Convert.ToInt32(arrayIO[(actualRow - 2)]);
+                yesterday = Convert.ToInt32(arrayIO[(actualRow - 1)]);
+               
             }
-
             if (intoMarket)
             {
                 intoMarket = false;
-                stringPrice = problemData.Dataset.GetValue((count-1), 1); //Extracting Open values
-                sellPrice = Convert.ToDouble(stringPrice);
-                profit1 += sellPrice - buyPrice;
-                charged = sellPrice * nShares * (1 - commission / 100);
-                cash = cash + charged + interest;
-                equity = cash;
+                sellPrice = Convert.ToDouble(arrayOpen[tick[actualRow]]);
+                profitTrade = profitTrade + sellPrice - buyPrice;
+                charged = nShares * sellPrice * (1.0 - COMISSION / 100);
+                cash = cash + interest + charged;
+                equity[actualRow] = cash;
                 nShares = 0;
+                totalTradeDays = totalTradeDays + nDias1 - 1;
+                tradeDays = tradeDays + nDias1 - 1;
             }
+            else
+            {
+                cash = cash + interest;
+                equity[actualRow] = cash;
+            }
+            
             return cash;
+        }
+
+        public static int getNumberTrades()
+        {
+            return numberTrades;
+        }
+        public static int getTradeDays()
+        {
+            return tradeDays;
+        }
+        public static int getTotalTradesDays()
+        {
+            return totalTradeDays;
         }
     }
Index: branches/sluengo/HeuristicLab.Problems.TradeRules/HeuristicLab.Problems.TradeRules-1.0.csproj
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/HeuristicLab.Problems.TradeRules-1.0.csproj	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/HeuristicLab.Problems.TradeRules-1.0.csproj	(revision 9386)
@@ -56,5 +56,4 @@
     <Compile Include="Symbols\Lag.cs" />
     <Compile Include="Symbols\MACD.cs" />
-    <Compile Include="Symbols\MACDTreeNode.cs" />
     <Compile Include="Symbols\Max.cs" />
     <Compile Include="Symbols\Min.cs" />
@@ -62,5 +61,4 @@
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\HeuristicLab.Problems.TradeRules-1.0.cs" />
-    <Compile Include="Symbols\RSI.cs" />
     <Compile Include="Evaluator\TradeRulesAnalysisEvaluator.cs" />
     <Compile Include="Evaluator\TradeRulesAnalysisSingleObjectiveEvaluator.cs" />
@@ -69,4 +67,5 @@
     <Compile Include="Problem\TradeRulesAbstractProblem.cs" />
     <Compile Include="Problem\TradeRulesProblem.cs" />
+    <Compile Include="Symbols\RSI.cs" />
     <Compile Include="TradeRulesSingleObjectiveTrainingBestSolutionAnalyzer.cs" />
     <Compile Include="TradeRulesSingleObjectiveValidationBestSolutionAnalyzer.cs" />
Index: branches/sluengo/HeuristicLab.Problems.TradeRules/Interpreter.cs
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/Interpreter.cs	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/Interpreter.cs	(revision 9386)
@@ -12,5 +12,4 @@
 using HeuristicLab.Problems.DataAnalysis;
 using System.Threading;
-using HeuristicLab.Problems.TradeRules.Symbols;
 
 namespace HeuristicLab.Problems.TradeRules
@@ -268,5 +267,5 @@
                         double result2 = Evaluate(dataset, ref row, state);
                         double total = result + result2;
-                        return total < 2 ? -1.0 : 1.0;
+                        return total < 2.0 ? -1.0 : 1.0;
                     }
                 case OpCodes.OR:
@@ -275,9 +274,9 @@
                         double result2 = Evaluate(dataset, ref row, state);
                         double total = result + result2;
-                        return total > -2 ? 1.0 : -1.0;
+                        return total > -2.0 ? 1.0 : -1.0;
                     }
                 case OpCodes.NOT:
                     {
-                        return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
+                        return Evaluate(dataset, ref row, state) > -1.0 ? -1.0 : 1.0;
                     }
 
@@ -373,5 +372,4 @@
                         double signalValue = -100000;
                         double macd = 0;
-                        double longitud = 0;
 
                         //Check if this MACD has previous values and retrieve them
@@ -381,11 +379,11 @@
 
                 
-                            //Calculating the factor for each EMA
-                            double factor = 2.0 / (firstEMA + 1.0);
-                            double factor2 = 2.0 / (secondEMA + 1.0);
-                            double factor3 = 2.0 / (signal + 1.0);
+                        //Calculating the factor for each EMA
+                        double factor = 2.0 / (firstEMA + 1.0);
+                        double factor2 = 2.0 / (secondEMA + 1.0);
+                        double factor3 = 2.0 / (signal + 1.0);
 
                             //Calculate the first value in the training for the two EMAs and the signal.
-                            if (row <= initialTraining || row == initialTest)
+                            if (row == initialTest)
                             {
                                 double [] meanValues = dataset.GetDoubleValues("\"Close\"", Enumerable.Range(0, row+1)).ToArray();
@@ -424,5 +422,5 @@
                             secondEMACache[currentInstr.dynamicNode] = secondElementEMA;
                             signalCache[currentInstr.dynamicNode] = signalValue;
-
+                           
                         return macd > signalValue ? 1.0 : -1.0;
                     }
@@ -447,5 +445,5 @@
                             double factor = 1.0 / numberOfDays;
 
-                            if (row == initialTraining || row == initialTest)
+                            if (row == initialTest)
                             {
                                 double[] closeValues = dataset.GetDoubleValues("\"Close\"", Enumerable.Range(0, (row + 1))).ToArray();
@@ -573,11 +571,11 @@
         public void clearVariables()
         {
-            signalCache.Clear();
-            firstEMACache.Clear();
-            secondEMACache.Clear();
-            RSIPositiveCache.Clear();
-            RSINegativeCache.Clear();
-            RSICache.Clear();
-            RSIOutputCache.Clear();
+            if (signalCache != null) signalCache.Clear();
+            if (firstEMACache != null) firstEMACache.Clear();
+            if (secondEMACache != null) secondEMACache.Clear();
+            if (RSIPositiveCache != null) RSIPositiveCache.Clear();
+            if (RSINegativeCache != null) RSINegativeCache.Clear();
+            if (RSICache != null) RSICache.Clear();
+            if (RSIOutputCache != null) RSIOutputCache.Clear();
         }
 
@@ -617,5 +615,5 @@
                 int row = rowEnum;
                 state.Reset();
-                if (row < initialTraining) yield return -1;
+                if (row < initialTest) yield return -1;
                 else yield return Evaluate(dataset, ref row, state);
             }
Index: branches/sluengo/HeuristicLab.Problems.TradeRules/Solution/TradeRulesSolutionBase.cs
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/Solution/TradeRulesSolutionBase.cs	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/Solution/TradeRulesSolutionBase.cs	(revision 9386)
@@ -29,4 +29,8 @@
         private const string TrainingMeanErrorResultName = "Mean error (training)";
         private const string TestMeanErrorResultName = "Mean error (test)";
+        private const string TestTradeDaysResultName = "Trade days";
+        private const string TestNumberTradesResultName = "Number of trades";
+        private const string TestTotalTradesResultName = "Total trades";
+
 
         public new IRegressionModel Model
@@ -58,4 +62,19 @@
             get { return ((DoubleValue)this[TestCashResultName].Value).Value; }
             private set { ((DoubleValue)this[TestCashResultName].Value).Value = value; }
+        }
+        public double TradeDays
+        {
+            get { return ((DoubleValue)this[TestTradeDaysResultName].Value).Value; }
+            private set { ((DoubleValue)this[TestTradeDaysResultName].Value).Value = value; }
+        }
+        public double NumberTrades
+        {
+            get { return ((DoubleValue)this[TestNumberTradesResultName].Value).Value; }
+            private set { ((DoubleValue)this[TestNumberTradesResultName].Value).Value = value; }
+        }
+        public double TotalTrades
+        {
+            get { return ((DoubleValue)this[TestTotalTradesResultName].Value).Value; }
+            private set { ((DoubleValue)this[TestTotalTradesResultName].Value).Value = value; }
         }
         public double TrainingMeanSquaredError
@@ -129,19 +148,10 @@
     protected TradeRulesSolutionBase(IRegressionModel model, IRegressionProblemData problemData)
       : base(model, problemData) {
-          Add(new Result(TrainingCashResultName, "Cash obtained after training period in the stock market", new DoubleValue()));
+      Add(new Result(TrainingCashResultName, "Cash obtained after training period in the stock market", new DoubleValue()));
       Add(new Result(TestCashResultName, "Cash obtained after test period in the stock market", new DoubleValue()));
-      Add(new Result(TrainingMeanSquaredErrorResultName, "Mean of squared errors of the model on the training partition", new DoubleValue()));
-      Add(new Result(TestMeanSquaredErrorResultName, "Mean of squared errors of the model on the test partition", new DoubleValue()));
-      Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue()));
-      Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleValue()));
-      Add(new Result(TrainingSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleValue()));
-      Add(new Result(TestSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleValue()));
-      Add(new Result(TrainingRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the training partition", new PercentValue()));
-      Add(new Result(TestRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the test partition", new PercentValue()));
-      Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the training partition", new DoubleValue()));
-      Add(new Result(TestNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the test partition", new DoubleValue()));
-      Add(new Result(TrainingMeanErrorResultName, "Mean of errors of the model on the training partition", new DoubleValue()));
-      Add(new Result(TestMeanErrorResultName, "Mean of errors of the model on the test partition", new DoubleValue()));
-    }
+      Add(new Result(TestTradeDaysResultName, "Number of trading days", new DoubleValue()));
+      Add(new Result(TestNumberTradesResultName, "Number of trades", new DoubleValue()));
+      Add(new Result(TestTotalTradesResultName, "Total trades", new DoubleValue()));
+     }
 
     [StorableHook(HookType.AfterDeserialization)]
@@ -194,39 +204,15 @@
         IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices);
 
-        OnlineCalculatorError errorState;
-        double trainingMSE = OnlineMeanSquaredErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingMSE : double.NaN;
-        double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestMeanSquaredError = errorState == OnlineCalculatorError.None ? testMSE : double.NaN;
-
-        double trainingMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN;
-        double testMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN;
-
-        double trainingR2 = OnlinePearsonsRSquaredCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR2 : double.NaN;
-        double testR2 = OnlinePearsonsRSquaredCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestRSquared = errorState == OnlineCalculatorError.None ? testR2 : double.NaN;
-
-        double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingRelativeError = errorState == OnlineCalculatorError.None ? trainingRelError : double.NaN;
-        double testRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestRelativeError = errorState == OnlineCalculatorError.None ? testRelError : double.NaN;
-
-        double trainingNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingNMSE : double.NaN;
-        double testNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNMSE : double.NaN;
-
-        double trainingME = OnlineMeanErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
-        TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
-        double testME = OnlineMeanErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
-        TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
-
         double trainingCTR = OnlineTradeRulesCalculator.Calculate(estimatedTrainingValues, ProblemData, ProblemData.TrainingIndices);
         TrainingCash = trainingCTR;
         double testCTR = OnlineTradeRulesCalculator.Calculate(estimatedTestValues, ProblemData, ProblemData.TestIndices);
         TestCash = testCTR;
+        double testTradeDays = OnlineTradeRulesCalculator.getTradeDays();
+        TradeDays = testTradeDays;
+        double testNumberTrades = OnlineTradeRulesCalculator.getNumberTrades();
+        NumberTrades = testNumberTrades;
+        double testTotalTradeDays = OnlineTradeRulesCalculator.getTotalTradesDays();
+        TotalTrades = testTotalTradeDays;
+
     }
 
Index: branches/sluengo/HeuristicLab.Problems.TradeRules/Symbols/MACD.cs
===================================================================
--- branches/sluengo/HeuristicLab.Problems.TradeRules/Symbols/MACD.cs	(revision 9385)
+++ branches/sluengo/HeuristicLab.Problems.TradeRules/Symbols/MACD.cs	(revision 9386)
@@ -7,5 +7,4 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Common;
-using HeuristicLab.Problems.TradeRules.Symbols;
 
 namespace HeuristicLab.Problems.TradeRules
@@ -38,9 +37,4 @@
         }
 
-        public override ISymbolicExpressionTreeNode CreateTreeNode()
-        {
-            return new MACDTreeNode(this);
-        }
-
         public override IDeepCloneable Clone(Cloner cloner)
         {
