Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/18 22:21:11 (6 years ago)
Author:
gkronber
Message:

#2915: merged r16241:16309 (current HEAD) from HL trunk to branch

Location:
branches/2915-AbsoluteSymbol
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2915-AbsoluteSymbol

  • branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Trading

  • branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Trading/3.4/ProblemData.cs

    r15583 r16332  
    16501650      OnChanged();
    16511651    }
    1652 
    1653     public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
    1654       var data = problemData as ProblemData;
    1655       if (data == null) throw new ArgumentException("The problem data is not a problem data set for trading. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
    1656 
    1657       string errorMessage;
    1658       if (!data.IsProblemDataCompatible(this, out errorMessage)) {
    1659         throw new InvalidOperationException(errorMessage);
    1660       }
    1661 
    1662       base.AdjustProblemDataProperties(data);
    1663 
    1664       var toDelete = PriceChangeVariableParameter.ValidValues.ToList();
    1665       foreach (var entry in data.PriceChangeVariableParameter.ValidValues) {
    1666         if (toDelete.Any(x => x.Value == entry.Value)) {
    1667           toDelete.RemoveAll(x => x.Value == entry.Value);
    1668         } else {
    1669           PriceChangeVariableParameter.ValidValues.Add(new StringValue(entry.Value));
    1670         }
    1671       }
    1672       PriceChangeVariableParameter.Value =
    1673         PriceChangeVariableParameter.ValidValues.Single(v => v.Value == data.PriceChangeVariable);
    1674 
    1675       foreach (var varToDelete in toDelete) PriceChangeVariableParameter.ValidValues.Remove(varToDelete);
    1676 
    1677       TransactionCostsParameter.Value.Value = data.TransactionCosts;
    1678 
    1679       OnChanged();
    1680     }
    16811652  }
    16821653}
  • branches/2915-AbsoluteSymbol/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/Model.cs

    r15583 r16332  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    5354    }
    5455
     56    public override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     57      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     58      return IsDatasetCompatible(problemData.Dataset, out errorMessage);
     59    }
     60
     61
    5562    // Transforms an enumerable of real values to an enumerable of trading signals (buy(1) / hold(0) / sell(-1))
    5663    public static IEnumerable<double> GetSignals(IEnumerable<double> xs) {
Note: See TracChangeset for help on using the changeset viewer.