Package com.strategyquant.tradinglib
Class Result
java.lang.Object
com.strategyquant.lib.ValuesMap
com.strategyquant.tradinglib.Result
- All Implemented Interfaces:
com.strategyquant.lib.settings.IXMLAble
,Serializable
The Class Result.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class com.strategyquant.lib.ValuesMap
BYTE_MISSING, DOUBLE_MISSING, FLOAT_MISSING, INT_MISSING, LONG_MISSING
-
Constructor Summary
ConstructorDescriptionResult(ResultsGroup resultsGroup)
This constructor is used when creating Result from XML.Result(String resultKey, ResultsGroup resultsGroup, SettingsMap settings)
Instantiates a new result. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMCSimulation(String mcMethod, com.strategyquant.tradinglib.robustnesstests.RobustnessResults rr)
Adds the MC simulation.void
addStrategy(StrategyBase strategy)
Adds the strategy.void
addStrategyXml(org.jdom2.Element elStrategy)
Adds the strategy xml.void
addTradingChartsData(com.strategyquant.tradinglib.engine.stockpicker.data.LoadedPickerData pickerdata, com.strategyquant.tradinglib.engine.stockpicker.Stockpicker stockPicker, OrdersList orders, boolean algoWizard)
void
addTradingChartsData(com.strategyquant.tradinglib.engine.TradingSetup ts, OrdersList orders, boolean algoWizard)
Adds the trading charts data.void
clear(boolean resetData, boolean removeStockChartsFile)
Clear.clone(ResultsGroup newRG)
Clone.void
computeAllStats(SettingsMap specialValues, com.strategyquant.tradinglib.strategy.OutOfSample oos)
computes stats for every possible combination.void
Copy stats.void
Free memory 2.double
getFitness(byte sampleType)
Gets the fitness.com.strategyquant.tradinglib.robustnesstests.RobustnessResults
getMCSimulation(String mcMethod, int i)
Gets the MC simulation.Gets the result key.com.strategyquant.tradinglib.robustnesstests.SequentialOptimizationResults
Gets the ChainOptimizationResults.Gets the settings.Gets the stock chart path.Gets the strategy.int
Gets the strategy problems.org.jdom2.Element
Gets the strategy xml.it.unimi.dsi.fastutil.longs.Long2FloatRBTreeMap
Gets the worst daily equity.org.jdom2.Element
getXML()
Gets the xml.boolean
Checks if is special.void
Removes the unsavable settings.void
setFitness(byte sampleType, double fitness)
Sets the fitness.void
Sets the from.void
setFromXML(org.jdom2.Element element)
Sets the from XML.void
setSequentialOptimizationResults(com.strategyquant.tradinglib.robustnesstests.SequentialOptimizationResults results)
Sets the ChainOptimizationResults.void
setSettings(SettingsMap settings)
Sets the settings.void
setSpecial(boolean special)
Sets the special.void
setStockChartPath(String stockChartPath)
Sets the stock chart path.void
setStrategyProblems(int badChecks)
Sets the strategy problems.void
setWorstDailyEquity(it.unimi.dsi.fastutil.longs.Long2FloatRBTreeMap worstDailyEquity)
Sets the worst daily equity.stats(byte direction, byte plType, byte sampleType)
Stats.stats(StatsTypeCombination combination)
Stats.statsOrNull(byte direction, byte plType, byte sampleType)
Stats or null.Methods inherited from class com.strategyquant.lib.ValuesMap
clear, clone, containsKey, containsKey, fromJSON, get, get, get, getAllKeys, getBoolean, getBoolean, getDouble, getDouble, getInt, getInt, getLong, getLong, getStatsIntKeyFromString, getString, getString, hashCode, remove, removeIgnoredKeys, removeUnsavableValues, set, set, setFromXML, setString, toJSON
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log.
-
-
Constructor Details
-
Result
This constructor is used when creating Result from XML.- Parameters:
resultsGroup
- the results group
-
Result
Instantiates a new result.- Parameters:
resultKey
- the result keyresultsGroup
- the results groupsettings
- the settings
-
-
Method Details
-
clone
Clone.- Parameters:
newRG
- the new RG- Returns:
- the result
-
setFrom
Sets the from.- Parameters:
result
- the resulttargetResultKey
- the target result key
-
stats
Stats.- Parameters:
combination
- the combination- Returns:
- the SQ stats
- Throws:
Exception
- the exception
-
stats
Stats.- Parameters:
direction
- the directionplType
- the pl typesampleType
- the sample type- Returns:
- the SQ stats
- Throws:
StatsDontExistException
- the stats dont exist exception
-
statsOrNull
Stats or null.- Parameters:
direction
- the directionplType
- the pl typesampleType
- the sample type- Returns:
- the SQ stats
-
addStrategy
Adds the strategy.- Parameters:
strategy
- the strategy
-
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
Gets the settings.- Returns:
- the settings
-
setSettings
Sets the settings.- Parameters:
settings
- the new settings
-
getResultKey
Gets the result key.- Returns:
- the resultKey
-
getXML
public org.jdom2.Element getXML()Gets the xml. -
setFromXML
public void setFromXML(org.jdom2.Element element)Sets the from XML.- Specified by:
setFromXML
in interfacecom.strategyquant.lib.settings.IXMLAble
- Overrides:
setFromXML
in classValuesMap
- Parameters:
element
- the new from XML
-
computeAllStats
public void computeAllStats(SettingsMap specialValues, com.strategyquant.tradinglib.strategy.OutOfSample oos) throws Exceptioncomputes stats for every possible combination.- Parameters:
specialValues
- the special valuesoos
- the oos- Throws:
Exception
- the exception
-
addTradingChartsData
public void addTradingChartsData(com.strategyquant.tradinglib.engine.TradingSetup ts, OrdersList orders, boolean algoWizard) throws ExceptionAdds the trading charts data.- Parameters:
ts
- the tsorders
- the orders- Throws:
Exception
- the exception
-
addTradingChartsData
public void addTradingChartsData(com.strategyquant.tradinglib.engine.stockpicker.data.LoadedPickerData pickerdata, com.strategyquant.tradinglib.engine.stockpicker.Stockpicker stockPicker, OrdersList orders, boolean algoWizard) throws Exception- Throws:
Exception
-
clear
public void clear(boolean resetData, boolean removeStockChartsFile)Clear.- Parameters:
resetData
- the reset dataremoveStockChartsFile
- 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
Copy stats.- Parameters:
sourceResult
- the source result
-
getStockChartPath
Gets the stock chart path.- Returns:
- the stock chart path
-
setStockChartPath
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(String mcMethod, com.strategyquant.tradinglib.robustnesstests.RobustnessResults rr)Adds the MC simulation.- Parameters:
mcMethod
- the mc methodrr
- the rr
-
getMCSimulation
public com.strategyquant.tradinglib.robustnesstests.RobustnessResults getMCSimulation(String mcMethod, int i)Gets the MC simulation.- Parameters:
mcMethod
- the mc methodi
- 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 typefitness
- the fitness
-
getSequentialOptimizaionResults
public com.strategyquant.tradinglib.robustnesstests.SequentialOptimizationResults getSequentialOptimizaionResults()Gets the ChainOptimizationResults.- Returns:
- the ChainOptimizationResults
-
setSequentialOptimizationResults
public void setSequentialOptimizationResults(com.strategyquant.tradinglib.robustnesstests.SequentialOptimizationResults results)Sets the ChainOptimizationResults.- Parameters:
results
-
-
getResultsGroup
-