Class Result

  • All Implemented Interfaces:
    com.strategyquant.lib.settings.IXMLAble, java.io.Serializable

    public class Result
    extends ValuesMap
    The Class Result.
    See Also:
    Serialized Form
    • Field Detail

      • Log

        public static final org.slf4j.Logger Log
        The Constant Log.
    • Constructor Detail

      • Result

        public Result​(ResultsGroup resultsGroup)
        This constructor is used when creating Result from XML.
        Parameters:
        resultsGroup - the results group
      • Result

        public Result​(java.lang.String resultKey,
                      ResultsGroup resultsGroup,
                      SettingsMap settings)
        Instantiates a new result.
        Parameters:
        resultKey - the result key
        resultsGroup - the results group
        settings - the settings
    • Method Detail

      • clone

        public Result clone​(ResultsGroup newRG)
        Clone.
        Parameters:
        newRG - the new RG
        Returns:
        the result
      • setFrom

        public void setFrom​(Result result,
                            java.lang.String targetResultKey)
        Sets the from.
        Parameters:
        result - the result
        targetResultKey - the target result key
      • stats

        public SQStats stats​(StatsTypeCombination combination)
                      throws java.lang.Exception
        Stats.
        Parameters:
        combination - the combination
        Returns:
        the SQ stats
        Throws:
        java.lang.Exception - the exception
      • stats

        public SQStats stats​(byte direction,
                             byte plType,
                             byte sampleType)
                      throws StatsDontExistException
        Stats.
        Parameters:
        direction - the direction
        plType - the pl type
        sampleType - the sample type
        Returns:
        the SQ stats
        Throws:
        StatsDontExistException - the stats dont exist exception
      • statsOrNull

        public SQStats statsOrNull​(byte direction,
                                   byte plType,
                                   byte sampleType)
        Stats or null.
        Parameters:
        direction - the direction
        plType - the pl type
        sampleType - the sample type
        Returns:
        the SQ stats
      • addStrategy

        public void addStrategy​(StrategyBase strategy)
        Adds the strategy.
        Parameters:
        strategy - the strategy
      • getStrategy

        public StrategyBase getStrategy()
        Gets the strategy.
        Returns:
        the strategy
      • addStrategyXml

        public void addStrategyXml​(org.jdom2.Element elStrategy)
        Adds the strategy xml.
        Parameters:
        elStrategy - the el strategy
      • getStrategyXml

        public org.jdom2.Element getStrategyXml()
        Gets the strategy xml.
        Returns:
        the strategy xml
      • getSettings

        public SettingsMap getSettings()
        Gets the settings.
        Returns:
        the settings
      • setSettings

        public void setSettings​(SettingsMap settings)
        Sets the settings.
        Parameters:
        settings - the new settings
      • getResultKey

        public java.lang.String getResultKey()
        Gets the result key.
        Returns:
        the resultKey
      • getXML

        public org.jdom2.Element getXML()
        Gets the xml.
        Specified by:
        getXML in interface com.strategyquant.lib.settings.IXMLAble
        Overrides:
        getXML in class ValuesMap
        Returns:
        the xml
      • setFromXML

        public void setFromXML​(org.jdom2.Element element)
        Sets the from XML.
        Specified by:
        setFromXML in interface com.strategyquant.lib.settings.IXMLAble
        Overrides:
        setFromXML in class ValuesMap
        Parameters:
        element - the new from XML
      • computeAllStats

        public void computeAllStats​(SettingsMap specialValues,
                                    OutOfSample oos)
                             throws java.lang.Exception
        computes stats for every possible combination.
        Parameters:
        specialValues - the special values
        oos - the oos
        Throws:
        java.lang.Exception - the exception
      • addTradingChartsData

        public void addTradingChartsData​(com.strategyquant.tradinglib.engine.TradingSetup ts,
                                         OrdersList orders)
                                  throws java.lang.Exception
        Adds the trading charts data.
        Parameters:
        ts - the ts
        orders - the orders
        Throws:
        java.lang.Exception - the exception
      • clear

        public void clear​(boolean resetData,
                          boolean removeStockChartsFile)
        Clear.
        Parameters:
        resetData - the reset data
        removeStockChartsFile - the remove stock charts file
      • freeMemory2

        public void freeMemory2()
        Free memory 2.
      • setStrategyProblems

        public void setStrategyProblems​(int badChecks)
        Sets the strategy problems.
        Parameters:
        badChecks - the new strategy problems
      • getStrategyProblems

        public int getStrategyProblems()
        Gets the strategy problems.
        Returns:
        the strategy problems
      • copyStats

        public void copyStats​(Result sourceResult)
        Copy stats.
        Parameters:
        sourceResult - the source result
      • getStockChartPath

        public java.lang.String getStockChartPath()
        Gets the stock chart path.
        Returns:
        the stock chart path
      • setStockChartPath

        public void setStockChartPath​(java.lang.String stockChartPath)
        Sets the stock chart path.
        Parameters:
        stockChartPath - the new stock chart path
      • getWorstDailyEquity

        public it.unimi.dsi.fastutil.longs.Long2FloatRBTreeMap getWorstDailyEquity()
        Gets the worst daily equity.
        Returns:
        the worst daily equity
      • setWorstDailyEquity

        public void setWorstDailyEquity​(it.unimi.dsi.fastutil.longs.Long2FloatRBTreeMap worstDailyEquity)
        Sets the worst daily equity.
        Parameters:
        worstDailyEquity - the new worst daily equity
      • isSpecial

        public boolean isSpecial()
        Checks if is special.
        Returns:
        true, if is special
      • setSpecial

        public void setSpecial​(boolean special)
        Sets the special.
        Parameters:
        special - the new special
      • removeUnsavableSettings

        public void removeUnsavableSettings()
        Removes the unsavable settings.
      • addMCSimulation

        public void addMCSimulation​(java.lang.String mcMethod,
                                    RobustnessResults rr)
        Adds the MC simulation.
        Parameters:
        mcMethod - the mc method
        rr - the rr
      • getMCSimulation

        public RobustnessResults getMCSimulation​(java.lang.String mcMethod,
                                                 int i)
        Gets the MC simulation.
        Parameters:
        mcMethod - the mc method
        i - the i
        Returns:
        the MC simulation
      • getFitness

        public double getFitness​(byte sampleType)
        Gets the fitness.
        Parameters:
        sampleType - the sample type
        Returns:
        the fitness
      • setFitness

        public void setFitness​(byte sampleType,
                               double fitness)
        Sets the fitness.
        Parameters:
        sampleType - the sample type
        fitness - the fitness
      • getSequentialOptimizaionResults

        public SequentialOptimizationResults getSequentialOptimizaionResults()
        Gets the ChainOptimizationResults.
        Returns:
        the ChainOptimizationResults
      • setSequentialOptimizationResults

        public void setSequentialOptimizationResults​(SequentialOptimizationResults results)
        Sets the ChainOptimizationResults.
        Parameters:
        results -