Changeset 9745 for branches/HeuristicLab.Problems.DataAnalysis.Trading
- Timestamp:
- 07/24/13 13:10:17 (11 years ago)
- Location:
- branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4
- Files:
-
- 2 edited
- 25 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/HeuristicLab.Problems.DataAnalysis.Trading-3.4.csproj
r9744 r9745 161 161 <Compile Include="Calculators\OnlineProfitCalculator.cs" /> 162 162 <Compile Include="HeuristicLabProblemsDataAnalysisTradingPlugin.cs" /> 163 <Compile Include="Interfaces\ITradingModel.cs" />164 <Compile Include="Interfaces\ITradingProblem.cs" />165 <Compile Include="Interfaces\ITradingProblemData.cs" />166 <Compile Include="Interfaces\ITradingSolution.cs" />167 163 <Compile Include="Calculators\OnlineSharpeRatioCalculator.cs" /> 168 <Compile Include="Symbolic\Interfaces\ISymbolicTradingEvaluator.cs" /> 169 <Compile Include="Symbolic\Interfaces\ISymbolicTradingModel.cs" /> 170 <Compile Include="Symbolic\Interfaces\ISymbolicTradingSingleObjectiveEvaluator.cs" /> 171 <Compile Include="Symbolic\Interfaces\ISymbolicTradingSolution.cs" /> 164 <Compile Include="Interfaces\IModel.cs" /> 165 <Compile Include="Interfaces\IProblem.cs" /> 166 <Compile Include="Interfaces\IProblemData.cs" /> 167 <Compile Include="Interfaces\ISolution.cs" /> 168 <Compile Include="Problem.cs" /> 169 <Compile Include="ProblemData.cs" /> 170 <Compile Include="Solution.cs" /> 171 <Compile Include="Symbolic\Interfaces\IEvaluator.cs" /> 172 <Compile Include="Symbolic\Interfaces\IModel.cs" /> 173 <Compile Include="Symbolic\Interfaces\ISingleObjectiveEvaluator.cs" /> 174 <Compile Include="Symbolic\Interfaces\ISolution.cs" /> 175 <Compile Include="Symbolic\Model.cs" /> 176 <Compile Include="Symbolic\SingleObjective\Evaluator.cs" /> 177 <Compile Include="Symbolic\SingleObjective\Problem.cs" /> 172 178 <Compile Include="Symbolic\SingleObjective\ProfitEvaluator.cs" /> 173 <Compile Include="Symbolic\SingleObjective\SymbolicTradingSingleObjectiveEvaluator.cs" /> 174 <Compile Include="Symbolic\SingleObjective\SymbolicTradingSingleObjectiveProblem.cs" /> 175 <Compile Include="Symbolic\SingleObjective\SymbolicTradingSingleObjectiveSharpeRatioEvaluator.cs" /> 176 <Compile Include="Symbolic\SingleObjective\SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer.cs" /> 177 <Compile Include="Symbolic\SingleObjective\SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer.cs" /> 178 <Compile Include="Symbolic\SymbolicTradingModel.cs" /> 179 <Compile Include="Symbolic\SymbolicTradingSolution.cs" /> 180 <Compile Include="Symbolic\Views\SymbolicTradingSolutionView.cs"> 179 <Compile Include="Symbolic\SingleObjective\SharpeRatioEvaluator.cs" /> 180 <Compile Include="Symbolic\SingleObjective\TrainingBestSolutionAnalyzer.cs" /> 181 <Compile Include="Symbolic\SingleObjective\ValidationBestSolutionAnalyzer.cs" /> 182 <Compile Include="Symbolic\Solution.cs" /> 183 <Compile Include="Symbolic\Views\SolutionView.cs"> 181 184 <SubType>UserControl</SubType> 182 185 </Compile> 183 <Compile Include="Symbolic\Views\SymbolicTradingSolutionView.Designer.cs"> 184 <DependentUpon>SymbolicTradingSolutionView.cs</DependentUpon> 185 </Compile> 186 <Compile Include="TradingProblem.cs" /> 187 <Compile Include="TradingProblemData.cs" /> 188 <Compile Include="TradingSolution.cs" /> 189 <Compile Include="Views\ITradingSolutionEvaluationView.cs" /> 190 <Compile Include="Views\TradingSolutionLineChartView.cs"> 186 <Compile Include="Symbolic\Views\SolutionView.Designer.cs"> 187 <DependentUpon>SolutionView.cs</DependentUpon> 188 </Compile> 189 <Compile Include="Views\ISolutionEvaluationView.cs" /> 190 <Compile Include="Views\SolutionLineChartView.cs"> 191 191 <SubType>UserControl</SubType> 192 192 </Compile> 193 <Compile Include="Views\ TradingSolutionLineChartView.Designer.cs">194 <DependentUpon> TradingSolutionLineChartView.cs</DependentUpon>195 </Compile> 196 <Compile Include="Views\ TradingSolutionView.cs">193 <Compile Include="Views\SolutionLineChartView.Designer.cs"> 194 <DependentUpon>SolutionLineChartView.cs</DependentUpon> 195 </Compile> 196 <Compile Include="Views\SolutionView.cs"> 197 197 <SubType>UserControl</SubType> 198 198 </Compile> 199 <Compile Include="Views\ TradingSolutionView.Designer.cs">200 <DependentUpon> TradingSolutionView.cs</DependentUpon>199 <Compile Include="Views\SolutionView.Designer.cs"> 200 <DependentUpon>SolutionView.cs</DependentUpon> 201 201 </Compile> 202 202 <None Include="HeuristicLab.snk" /> -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Interfaces/IModel.cs
r9743 r9745 22 22 using System.Collections.Generic; 23 23 namespace HeuristicLab.Problems.DataAnalysis.Trading { 24 public interface I TradingModel : IDataAnalysisModel {24 public interface IModel : IDataAnalysisModel { 25 25 IEnumerable<double> GetSignals(Dataset dataset, IEnumerable<int> rows); 26 26 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Interfaces/IProblem.cs
r9743 r9745 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Trading { 23 public interface I TradingProblem : IDataAnalysisProblem<ITradingProblemData> {23 public interface IProblem : IDataAnalysisProblem<IProblemData> { 24 24 } 25 25 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Interfaces/IProblemData.cs
r9743 r9745 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Trading { 23 public interface I TradingProblemData : IDataAnalysisProblemData {23 public interface IProblemData : IDataAnalysisProblemData { 24 24 string PriceVariable { get; } 25 25 double TransactionCosts { get; } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Interfaces/ISolution.cs
r9743 r9745 22 22 using System.Collections.Generic; 23 23 namespace HeuristicLab.Problems.DataAnalysis.Trading { 24 public interface I TradingSolution : IDataAnalysisSolution {25 new I TradingModel Model { get; }26 new I TradingProblemData ProblemData { get; }24 public interface ISolution : IDataAnalysisSolution { 25 new IModel Model { get; } 26 new IProblemData ProblemData { get; } 27 27 28 28 IEnumerable<double> Signals { get; } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Problem.cs
r9743 r9745 28 28 [Item("Trading Problem", "A general trading problem.")] 29 29 [Creatable("Problems")] 30 public class TradingProblem : DataAnalysisProblem<ITradingProblemData>, ITradingProblem {30 public class Problem : DataAnalysisProblem<IProblemData>, IProblem { 31 31 [StorableConstructor] 32 protected TradingProblem(bool deserializing) : base(deserializing) { }33 protected TradingProblem(TradingProblem original, Cloner cloner) : base(original, cloner) { }32 protected Problem(bool deserializing) : base(deserializing) { } 33 protected Problem(Problem original, Cloner cloner) : base(original, cloner) { } 34 34 public override IDeepCloneable Clone(Cloner cloner) { 35 return new TradingProblem(this, cloner); }35 return new Problem(this, cloner); } 36 36 37 public TradingProblem()37 public Problem() 38 38 : base() { 39 ProblemData = new TradingProblemData();39 ProblemData = new ProblemData(); 40 40 } 41 41 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs
r9744 r9745 32 32 [StorableClass] 33 33 [Item("TradingProblemData", "Represents an item containing all data defining a trading problem.")] 34 public sealed class TradingProblemData : DataAnalysisProblemData, ITradingProblemData {34 public sealed class ProblemData : DataAnalysisProblemData, IProblemData { 35 35 private const string PriceVariableParameterName = "PriceVariable"; 36 36 private const string TransactionCostsParameterName = "TransactionCosts"; … … 1588 1588 private static string defaultPriceVariable; 1589 1589 1590 static TradingProblemData() {1590 static ProblemData() { 1591 1591 defaultDataset = new Dataset(new string[] { "AUD" }, audInUsdDiff); 1592 1592 defaultDataset.Name = "AUD in USD"; … … 1611 1611 1612 1612 [StorableConstructor] 1613 private TradingProblemData(bool deserializing) : base(deserializing) { }1613 private ProblemData(bool deserializing) : base(deserializing) { } 1614 1614 [StorableHook(HookType.AfterDeserialization)] 1615 1615 private void AfterDeserialization() { … … 1617 1617 } 1618 1618 1619 private TradingProblemData(TradingProblemData original, Cloner cloner)1619 private ProblemData(ProblemData original, Cloner cloner) 1620 1620 : base(original, cloner) { 1621 1621 RegisterParameterEvents(); 1622 1622 } 1623 public override IDeepCloneable Clone(Cloner cloner) { return new TradingProblemData(this, cloner); }1623 public override IDeepCloneable Clone(Cloner cloner) { return new ProblemData(this, cloner); } 1624 1624 1625 public TradingProblemData()1625 public ProblemData() 1626 1626 : this(defaultDataset, defaultAllowedInputVariables, defaultPriceVariable) { 1627 1627 } 1628 1628 1629 public TradingProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)1629 public ProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) 1630 1630 : base(dataset, allowedInputVariables) { 1631 1631 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Solution.cs
r9744 r9745 32 32 /// </summary> 33 33 [StorableClass] 34 public abstract class TradingSolution : DataAnalysisSolution, ITradingSolution {34 public abstract class Solution : DataAnalysisSolution, ISolution { 35 35 private const string TrainingSharpeRatioResultName = "Sharpe ratio (training)"; 36 36 private const string TestSharpeRatioResultName = "Sharpe ratio (test)"; … … 38 38 private const string TestProfitResultName = "Profit (test)"; 39 39 40 public new I TradingModel Model {41 get { return (I TradingModel)base.Model; }40 public new IModel Model { 41 get { return (IModel)base.Model; } 42 42 protected set { base.Model = value; } 43 43 } 44 44 45 public new I TradingProblemData ProblemData {46 get { return (I TradingProblemData)base.ProblemData; }45 public new IProblemData ProblemData { 46 get { return (IProblemData)base.ProblemData; } 47 47 protected set { base.ProblemData = value; } 48 48 } … … 68 68 69 69 [StorableConstructor] 70 protected TradingSolution(bool deserializing) : base(deserializing) { }71 protected TradingSolution(TradingSolution original, Cloner cloner)70 protected Solution(bool deserializing) : base(deserializing) { } 71 protected Solution(Solution original, Cloner cloner) 72 72 : base(original, cloner) { 73 73 } 74 public TradingSolution(ITradingModel model, ITradingProblemData problemData)74 public Solution(IModel model, IProblemData problemData) 75 75 : base(model, problemData) { 76 76 Add(new Result(TrainingSharpeRatioResultName, "Share ratio of the signals of the model on the training partition", new DoubleValue())); -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Interfaces/IEvaluator.cs
r9743 r9745 23 23 24 24 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading { 25 public interface I SymbolicTradingEvaluator : ISymbolicDataAnalysisEvaluator<ITradingProblemData> {25 public interface IEvaluator : ISymbolicDataAnalysisEvaluator<IProblemData> { 26 26 } 27 27 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Interfaces/IModel.cs
r9743 r9745 23 23 24 24 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading { 25 public interface I SymbolicTradingModel : ITradingModel, ISymbolicDataAnalysisModel {25 public interface IModel : DataAnalysis.Trading.IModel, ISymbolicDataAnalysisModel { 26 26 } 27 27 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Interfaces/ISingleObjectiveEvaluator.cs
r9743 r9745 23 23 24 24 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading { 25 public interface IS ymbolicTradingSingleObjectiveEvaluator : ISymbolicTradingEvaluator, ISymbolicDataAnalysisSingleObjectiveEvaluator<ITradingProblemData> {25 public interface ISingleObjectiveEvaluator : IEvaluator, ISymbolicDataAnalysisSingleObjectiveEvaluator<IProblemData> { 26 26 } 27 27 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Interfaces/ISolution.cs
r9743 r9745 24 24 25 25 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading { 26 public interface IS ymbolicTradingSolution : ITradingSolution, ISymbolicDataAnalysisSolution {27 new I SymbolicTradingModel Model { get; }26 public interface ISolution : DataAnalysis.Trading.ISolution, ISymbolicDataAnalysisSolution { 27 new IModel Model { get; } 28 28 } 29 29 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Model.cs
r9744 r9745 32 32 /// </summary> 33 33 [StorableClass] 34 [Item(Name = " SymbolicTradingModel", Description = "Represents a symbolic trading model.")]35 public class SymbolicTradingModel : SymbolicDataAnalysisModel, ISymbolicTradingModel {34 [Item(Name = "Model (symbolic trading)", Description = "Represents a symbolic trading model.")] 35 public class Model : SymbolicDataAnalysisModel, IModel { 36 36 37 37 [StorableConstructor] 38 protected SymbolicTradingModel(bool deserializing) : base(deserializing) { }39 protected SymbolicTradingModel(SymbolicTradingModel original, Cloner cloner)38 protected Model(bool deserializing) : base(deserializing) { } 39 protected Model(Model original, Cloner cloner) 40 40 : base(original, cloner) { } 41 public SymbolicTradingModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter)41 public Model(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter) 42 42 : base(tree, interpreter, -10, 10) { } 43 43 44 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new SymbolicTradingModel(this, cloner);45 return new Model(this, cloner); 46 46 } 47 47 -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/Evaluator.cs
r9743 r9745 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading { 28 public abstract class S ymbolicTradingSingleObjectiveEvaluator : SymbolicDataAnalysisSingleObjectiveEvaluator<ITradingProblemData>, ISymbolicTradingSingleObjectiveEvaluator {28 public abstract class SingleObjectiveEvaluator : SymbolicDataAnalysisSingleObjectiveEvaluator<IProblemData>, ISingleObjectiveEvaluator { 29 29 [StorableConstructor] 30 protected S ymbolicTradingSingleObjectiveEvaluator(bool deserializing) : base(deserializing) { }31 protected S ymbolicTradingSingleObjectiveEvaluator(SymbolicTradingSingleObjectiveEvaluator original, Cloner cloner)30 protected SingleObjectiveEvaluator(bool deserializing) : base(deserializing) { } 31 protected SingleObjectiveEvaluator(SingleObjectiveEvaluator original, Cloner cloner) 32 32 : base(original, cloner) { 33 33 } 34 34 35 protected S ymbolicTradingSingleObjectiveEvaluator() : base() { }35 protected SingleObjectiveEvaluator() : base() { } 36 36 } 37 37 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/Problem.cs
r9743 r9745 29 29 [StorableClass] 30 30 [Creatable("Problems")] 31 public class S ymbolicTradingSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<ITradingProblemData, ISymbolicTradingSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, ITradingProblem {31 public class SingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IProblemData, ISingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IProblem { 32 32 private const int InitialMaximumTreeDepth = 8; 33 33 private const int InitialMaximumTreeLength = 25; 34 34 35 35 [StorableConstructor] 36 protected S ymbolicTradingSingleObjectiveProblem(bool deserializing) : base(deserializing) { }37 protected S ymbolicTradingSingleObjectiveProblem(SymbolicTradingSingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { }38 public override IDeepCloneable Clone(Cloner cloner) { return new S ymbolicTradingSingleObjectiveProblem(this, cloner); }36 protected SingleObjectiveProblem(bool deserializing) : base(deserializing) { } 37 protected SingleObjectiveProblem(SingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { } 38 public override IDeepCloneable Clone(Cloner cloner) { return new SingleObjectiveProblem(this, cloner); } 39 39 40 public S ymbolicTradingSingleObjectiveProblem()41 : base(new TradingProblemData(), new SymbolicTradingSingleObjectiveSharpeRatioEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) {40 public SingleObjectiveProblem() 41 : base(new ProblemData(), new SharpeRatioEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 42 42 Maximization.Value = true; 43 43 MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth; … … 48 48 49 49 private void InitializeOperators() { 50 Operators.Add(new SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer());51 Operators.Add(new SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer());50 Operators.Add(new TrainingBestSolutionAnalyzer()); 51 Operators.Add(new ValidationBestSolutionAnalyzer()); 52 52 ParameterizeOperators(); 53 53 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/ProfitEvaluator.cs
r9744 r9745 32 32 [Item("Profit Evaluator", "")] 33 33 [StorableClass] 34 public class ProfitEvaluator : S ymbolicTradingSingleObjectiveEvaluator {34 public class ProfitEvaluator : SingleObjectiveEvaluator { 35 35 [StorableConstructor] 36 36 protected ProfitEvaluator(bool deserializing) : base(deserializing) { } … … 58 58 } 59 59 60 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, I TradingProblemData problemData, IEnumerable<int> rows) {60 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, IProblemData problemData, IEnumerable<int> rows) { 61 61 IEnumerable<double> signals = GetSignals(interpreter, solution, problemData.Dataset, rows); 62 62 IEnumerable<double> returns = problemData.Dataset.GetDoubleValues(problemData.PriceVariable, rows); … … 68 68 69 69 private static IEnumerable<double> GetSignals(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, Dataset dataset, IEnumerable<int> rows) { 70 return SymbolicTradingModel.GetSignals(interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows));70 return Model.GetSignals(interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows)); 71 71 } 72 72 73 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, I TradingProblemData problemData, IEnumerable<int> rows) {73 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IProblemData problemData, IEnumerable<int> rows) { 74 74 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 75 75 double profit = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, problemData, rows); -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SharpeRatioEvaluator.cs
r9744 r9745 32 32 [Item("Sharpe Ratio Evaluator", "")] 33 33 [StorableClass] 34 public class S ymbolicTradingSingleObjectiveSharpeRatioEvaluator : SymbolicTradingSingleObjectiveEvaluator {34 public class SharpeRatioEvaluator : SingleObjectiveEvaluator { 35 35 [StorableConstructor] 36 protected S ymbolicTradingSingleObjectiveSharpeRatioEvaluator(bool deserializing) : base(deserializing) { }37 protected S ymbolicTradingSingleObjectiveSharpeRatioEvaluator(SymbolicTradingSingleObjectiveSharpeRatioEvaluator original, Cloner cloner)36 protected SharpeRatioEvaluator(bool deserializing) : base(deserializing) { } 37 protected SharpeRatioEvaluator(SharpeRatioEvaluator original, Cloner cloner) 38 38 : base(original, cloner) { 39 39 } 40 public S ymbolicTradingSingleObjectiveSharpeRatioEvaluator()40 public SharpeRatioEvaluator() 41 41 : base() { 42 42 } 43 43 44 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new S ymbolicTradingSingleObjectiveSharpeRatioEvaluator(this, cloner);45 return new SharpeRatioEvaluator(this, cloner); 46 46 } 47 47 … … 58 58 } 59 59 60 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, I TradingProblemData problemData, IEnumerable<int> rows) {60 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, IProblemData problemData, IEnumerable<int> rows) { 61 61 IEnumerable<double> signals = GetSignals(interpreter, solution, problemData.Dataset, rows); 62 62 IEnumerable<double> returns = problemData.Dataset.GetDoubleValues(problemData.PriceVariable, rows); … … 68 68 69 69 private static IEnumerable<double> GetSignals(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, Dataset dataset, IEnumerable<int> rows) { 70 return SymbolicTradingModel.GetSignals(interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows));70 return Model.GetSignals(interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows)); 71 71 } 72 72 73 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, I TradingProblemData problemData, IEnumerable<int> rows) {73 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IProblemData problemData, IEnumerable<int> rows) { 74 74 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 75 75 double sharpRatio = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, problemData, rows); -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/TrainingBestSolutionAnalyzer.cs
r9743 r9745 31 31 /// An operator that analyzes the training best symbolic trading solution for single objective symbolic trading problems. 32 32 /// </summary> 33 [Item(" SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic trading solution for single objective symbolic trading problems.")]33 [Item("Training-best Solution Analyzer (symbolic trading)", "An operator that analyzes the training best symbolic trading solution for single objective symbolic trading problems.")] 34 34 [StorableClass] 35 public sealed class SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISymbolicTradingSolution>,35 public sealed class TrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISolution>, 36 36 ISymbolicDataAnalysisInterpreterOperator { 37 37 private const string ProblemDataParameterName = "ProblemData"; 38 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 39 39 #region parameter properties 40 public ILookupParameter<I TradingProblemData> ProblemDataParameter {41 get { return (ILookupParameter<I TradingProblemData>)Parameters[ProblemDataParameterName]; }40 public ILookupParameter<IProblemData> ProblemDataParameter { 41 get { return (ILookupParameter<IProblemData>)Parameters[ProblemDataParameterName]; } 42 42 } 43 43 public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { … … 47 47 48 48 [StorableConstructor] 49 private SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }50 private SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer(SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }51 public SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer()49 private TrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { } 50 private TrainingBestSolutionAnalyzer(TrainingBestSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { } 51 public TrainingBestSolutionAnalyzer() 52 52 : base() { 53 Parameters.Add(new LookupParameter<I TradingProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution."));53 Parameters.Add(new LookupParameter<IProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution.")); 54 54 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 55 55 } 56 56 public override IDeepCloneable Clone(Cloner cloner) { 57 return new SymbolicTradingSingleObjectiveTrainingBestSolutionAnalyzer(this, cloner);57 return new TrainingBestSolutionAnalyzer(this, cloner); 58 58 } 59 59 60 protected override IS ymbolicTradingSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {61 var model = new SymbolicTradingModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue);62 return new Symbolic TradingSolution(model, (ITradingProblemData)ProblemDataParameter.ActualValue.Clone());60 protected override ISolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 61 var model = new Model((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue); 62 return new SymbolicSolution(model, (IProblemData)ProblemDataParameter.ActualValue.Clone()); 63 63 } 64 64 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/ValidationBestSolutionAnalyzer.cs
r9743 r9745 30 30 /// An operator that analyzes the validation best symbolic trading solution for single objective symbolic trading problems. 31 31 /// </summary> 32 [Item(" SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic trading solution for single objective symbolic trading problems.")]32 [Item("Validation-best Solution Analyzer (symbolic trading)", "An operator that analyzes the validation best symbolic trading solution for single objective symbolic trading problems.")] 33 33 [StorableClass] 34 public sealed class SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicTradingSolution, ISymbolicTradingSingleObjectiveEvaluator, ITradingProblemData> {34 public sealed class ValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISolution, ISingleObjectiveEvaluator, IProblemData> { 35 35 36 36 [StorableConstructor] 37 private SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }38 private SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer(SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }39 public SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer()37 private ValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { } 38 private ValidationBestSolutionAnalyzer(ValidationBestSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { } 39 public ValidationBestSolutionAnalyzer() 40 40 : base() { 41 41 } 42 42 43 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new SymbolicTradingSingleObjectiveValidationBestSolutionAnalyzer(this, cloner);44 return new ValidationBestSolutionAnalyzer(this, cloner); 45 45 } 46 46 47 protected override IS ymbolicTradingSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {48 var model = new SymbolicTradingModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue);49 return new Symbolic TradingSolution(model, (ITradingProblemData)ProblemDataParameter.ActualValue.Clone());47 protected override ISolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 48 var model = new Model((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue); 49 return new SymbolicSolution(model, (IProblemData)ProblemDataParameter.ActualValue.Clone()); 50 50 } 51 51 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Solution.cs
r9744 r9745 32 32 /// </summary> 33 33 [StorableClass] 34 [Item(Name = "S ymbolicTradingSolution",34 [Item(Name = "Solution (symbolic trading)", 35 35 Description = 36 36 "Represents a symbolic trading solution (model + data) and attributes of the solution like accuracy and complexity." 37 37 )] 38 public sealed class Symbolic TradingSolution : TradingSolution, ISymbolicTradingSolution {38 public sealed class SymbolicSolution : Solution, ISolution { 39 39 private const string ModelLengthResultName = "Model Length"; 40 40 private const string ModelDepthResultName = "Model Depth"; 41 41 42 public new I SymbolicTradingModel Model {43 get { return (I SymbolicTradingModel)base.Model; }42 public new IModel Model { 43 get { return (IModel)base.Model; } 44 44 set { base.Model = value; } 45 45 } … … 60 60 61 61 [StorableConstructor] 62 private Symbolic TradingSolution(bool deserializing)62 private SymbolicSolution(bool deserializing) 63 63 : base(deserializing) { 64 64 } 65 65 66 private Symbolic TradingSolution(SymbolicTradingSolution original, Cloner cloner)66 private SymbolicSolution(SymbolicSolution original, Cloner cloner) 67 67 : base(original, cloner) { 68 68 } 69 69 70 public Symbolic TradingSolution(ISymbolicTradingModel model, ITradingProblemData problemData)70 public SymbolicSolution(IModel model, IProblemData problemData) 71 71 : base(model, problemData) { 72 72 Add(new Result(ModelLengthResultName, "Length of the symbolic trading model.", new IntValue())); … … 76 76 77 77 public override IDeepCloneable Clone(Cloner cloner) { 78 return new Symbolic TradingSolution(this, cloner);78 return new SymbolicSolution(this, cloner); 79 79 } 80 80 -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Views/SolutionView.Designer.cs
r9743 r9745 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading.Views { 23 partial class S ymbolicTradingSolutionView {23 partial class SolutionView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Views/SolutionView.cs
r9743 r9745 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Trading.Views { 27 [Content(typeof(Symbolic TradingSolution), true)]27 [Content(typeof(SymbolicSolution), true)] 28 28 [View("SymbolicTradingSolution View")] 29 public partial class S ymbolicTradingSolutionView : TradingSolutionView {30 public S ymbolicTradingSolutionView() {29 public partial class SolutionView : DataAnalysis.Trading.Views.SolutionView { 30 public SolutionView() { 31 31 InitializeComponent(); 32 32 } 33 33 34 protected new Symbolic TradingSolution Content {35 get { return (Symbolic TradingSolution)base.Content; }34 protected new SymbolicSolution Content { 35 get { return (SymbolicSolution)base.Content; } 36 36 set { base.Content = value; } 37 37 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/ISolutionEvaluationView.cs
r9743 r9745 20 20 #endregion 21 21 22 using HeuristicLab.Problems.DataAnalysis. Trading;22 using HeuristicLab.Problems.DataAnalysis.Views; 23 23 24 namespace HeuristicLab.Problems.DataAnalysis. Views {25 public interface I TradingSolutionEvaluationView : IDataAnalysisSolutionEvaluationView {26 new I TradingSolution Content { get; set; }24 namespace HeuristicLab.Problems.DataAnalysis.Trading.Views { 25 public interface ISolutionEvaluationView : IDataAnalysisSolutionEvaluationView { 26 new ISolution Content { get; set; } 27 27 } 28 28 } -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/SolutionLineChartView.Designer.cs
r9743 r9745 20 20 #endregion 21 21 namespace HeuristicLab.Problems.DataAnalysis.Trading.Views { 22 partial class TradingSolutionLineChartView {22 partial class SolutionLineChartView { 23 23 /// <summary> 24 24 /// Required designer variable. -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/SolutionLineChartView.cs
r9744 r9745 30 30 namespace HeuristicLab.Problems.DataAnalysis.Trading.Views { 31 31 [View("Line Chart")] 32 [Content(typeof(I TradingSolution))]33 public partial class TradingSolutionLineChartView : DataAnalysisSolutionEvaluationView, ITradingSolutionEvaluationView {32 [Content(typeof(ISolution))] 33 public partial class SolutionLineChartView : DataAnalysisSolutionEvaluationView, ISolutionEvaluationView { 34 34 private const string PRICEVARIABLE_SERIES_NAME = "Price"; 35 35 private const string SIGNALS_SERIES_NAME = "Signals"; … … 37 37 38 38 39 public new I TradingSolution Content {40 get { return (I TradingSolution)base.Content; }39 public new ISolution Content { 40 get { return (ISolution)base.Content; } 41 41 set { base.Content = value; } 42 42 } 43 43 44 public TradingSolutionLineChartView()44 public SolutionLineChartView() 45 45 : base() { 46 46 InitializeComponent(); -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/SolutionView.Designer.cs
r9743 r9745 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Trading.Views { 23 partial class TradingSolutionView {23 partial class SolutionView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Views/SolutionView.cs
r9743 r9745 27 27 namespace HeuristicLab.Problems.DataAnalysis.Trading.Views { 28 28 [View("TradingSolution View")] 29 [Content(typeof( TradingSolution), true)]30 public partial class TradingSolutionView : DataAnalysisSolutionView {31 public TradingSolutionView() {29 [Content(typeof(Solution), true)] 30 public partial class SolutionView : DataAnalysisSolutionView { 31 public SolutionView() { 32 32 InitializeComponent(); 33 33 34 var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(I TradingSolutionEvaluationView), true);34 var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(ISolutionEvaluationView), true); 35 35 foreach (Type viewType in regressionSolutionEvaluationViewTypes) 36 36 AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph); 37 37 } 38 38 39 public new TradingSolution Content {40 get { return ( TradingSolution)base.Content; }39 public new Solution Content { 40 get { return (Solution)base.Content; } 41 41 set { base.Content = value; } 42 42 }
Note: See TracChangeset
for help on using the changeset viewer.