Package com.strategyquant.tradinglib
Class BadStrategyException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.strategyquant.datalib.TradingException
com.strategyquant.tradinglib.BadStrategyException
- All Implemented Interfaces:
Serializable
The Class BadStrategyException.
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The Constant ExplanationUnknown.static int
The Constant PrefixCrossCheckConditions.static int
The Constant PrefixInitialConditions.static int
The Constant PrefixNormalConditions.static int
The Constant ReasonAdditionalMarketsFilter.static int
The Constant ReasonAmbiguousTrades.static int
The Constant ReasonBacktestException.static int
The Constant ReasonCCExceptionAddMarkets.static int
The Constant ReasonCCExceptionHigherBacktestPrecis.static int
The Constant ReasonCCExceptionMCManipulation.static int
The Constant ReasonCCExceptionMCRetest.static int
The Constant ReasonCCExceptionOptProfileSPP.static int
The Constant ReasonCCExceptionSequentialOptimization.static int
The Constant ReasonCCExceptionWFMatrix.static int
The Constant ReasonCCExceptionWFOptim.static int
The Constant ReasonCCExceptionWhatIf.static int
The Constant CorrelationWithExistingPortfolio.static int
The Constant ReasonCrossCheckException.static int
The Constant ReasonCustomAnalysisFilter.static int
The Constant ReasonExceptionEvaluatingConditions.static int
The Constant ReasonInitialPopulation.static int
The Constant ReasonNoFilledTrades.static int
The Constant ReasonNoTrades.static int
The Constant ReasonOptProfileAvgProfit.static int
The Constant ReasonOptProfileBestOptimizationProfit.static int
The Constant ReasonOptProfileProfitableOptimizations.static int
The Constant ReasonOptProfileUniformDistribution.static int
The Constant ReasonOutlierTrade.static int
The Constant PortfolioMasterCorrelationLimitation.static int
The Constant PortfolioMasterSectorLimitation.static int
The Constant ReasonReplacedWithBetterStrategy.static int
The Constant ReasonStockpickerShiftChanged.static int
The Constant ReasonStopped.static int
The Constant ReasonStrategyTooSimilar.static int
The Constant ReasonThreshold.static int
The Constant ReasonTooLittleTrades.static int
The Constant ReasonTooLongTrade.static int
The Constant ReasonTooManyOpenTrades.static int
The Constant ReasonTooShortTrades.static int
The Constant ReasonWrongParamsException.static int
The Constant ReasonZeroDurationTrades.static int
The Constant ReasonZeroPLTrades.static String
The Constant ReplacedWorseStrategy.static String
The Constant TxtCorrelationWithExistingPortfolio.static String
The Constant TxtLongAdditionalMarketsFilter.static String
The Constant TxtLongOptProfileAvgProfit.static String
The Constant TxtLongOptProfileBestOptimizationProfit.static String
The Constant TxtLongOptProfileProfitableOptimizations.static String
The Constant TxtLongOptProfileUniformDistribution.static String
The Constant TxtLongReasonAmbiguousTrades.static String
The Constant TxtLongReasonInitialPopulation.static String
The Constant TxtLongReasonNoFilledTrades.static String
The Constant TxtLongReasonNoTrades.static String
The Constant TxtLongReasonOutlierTrade.static String
The Constant TxtLongReasonStockpickerShiftChanged.static String
The Constant TxtLongReasonStrategyTooSimilar.static String
The Constant TxtLongReasonTooLittleTrades.static String
The Constant TxtLongReasonTooLongTrade.static String
The Constant TxtLongReasonTooManyOpenTrades.static String
The Constant TxtLongReasonTooShortTrades.static String
The Constant TxtLongReasonZeroDurationTrades.static String
The Constant TxtLongReasonZeroPLTrades.static String
The Constant TxtLongReplacedWithBetterStrategy.static String
The Constant TxtPortfolioMasterCorrelationLimitation.static String
The Constant TxtPortfolioMasterSectorLimitation.static String
The Constant TxtReasonCCExceptionAddMarkets.static String
The Constant TxtReasonCCExceptionHigherBacktestPrecis.static String
The Constant TxtReasonCCExceptionMCManipulation.static String
The Constant TxtReasonCCExceptionMCRetest.static String
The Constant TxtReasonCCExceptionOptProfileSPP.static String
The Constant TxtReasonCCExceptionChainOptimization.static String
The Constant TxtReasonCCExceptionWFMatrix.static String
The Constant TxtReasonCCExceptionWFOptim.static String
The Constant TxtShorAdditionalMarketsFilter.static String
The Constant TxtShortOptProfileAvgProfit.static String
The Constant TxtShortOptProfileBestOptimizationProfit.static String
The Constant TxtShortOptProfileProfitableOptimizations.static String
The Constant TxtShortOptProfileUniformDistribution.static String
The Constant TxtShortReasonAmbiguousTrades.static String
The Constant TxtShortReasonInitialPopulation.static String
The Constant TxtShortReasonNoFilledTrades.static String
The Constant TxtShortReasonNoTrades.static String
The Constant TxtShortReasonOutlierTrade.static String
The Constant TxtShortReasonStrategyTooSimilar.static String
The Constant TxtShortReasonTooLittleTrades.static String
The Constant TxtShortReasonTooLongTrade.static String
The Constant TxtShortReasonTooManyOpenTrades.static String
The Constant TxtShortReasonTooShortTrades.static String
The Constant TxtShortReasonZeroDurationTrades.static String
The Constant TxtShortReasonZeroPLTrades.static String
The Constant TxtShortReplacedWithBetterStrategy.Fields inherited from class com.strategyquant.datalib.TradingException
IndicatorCalculationFailed
-
Constructor Summary
ConstructorDescriptionBadStrategyException(int reason)
Instantiates a new bad strategy exception. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
check(int checkType, int reason)
Check.static String
getExplanation(int reason)
Gets the explanation.static int
getFirstReason(int strategyProblems)
Gets the first reason.static int
getFirstReason(int strategyProblems, int dismissBadStrategies)
Gets the first reason.Gets the message.int
Gets the reason.Gets the reason as string.static String
getReasonAsString(int reason)
Gets the reason as string.static it.unimi.dsi.fastutil.ints.IntArrayList
getSubReasons(int dismissalReason)
Gets the sub reasons.static boolean
isBadStrategyException(int reason)
Checks if is bad strategy exception.static ArrayList<com.strategyquant.tradinglib.exception.StrategyProblem>
List problems.static String
reasonToShortText(int reason)
Reason to short text.static int
setOrThrow(int throwType, boolean warnings, int reason)
Sets the or throw.Methods inherited from class com.strategyquant.datalib.TradingException
addCall, getErrorCode
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ReasonNoTrades
public static final int ReasonNoTradesThe Constant ReasonNoTrades.- See Also:
- Constant Field Values
-
ReasonTooLittleTrades
public static final int ReasonTooLittleTradesThe Constant ReasonTooLittleTrades.- See Also:
- Constant Field Values
-
ReasonZeroPLTrades
public static final int ReasonZeroPLTradesThe Constant ReasonZeroPLTrades.- See Also:
- Constant Field Values
-
ReasonTooShortTrades
public static final int ReasonTooShortTradesThe Constant ReasonTooShortTrades.- See Also:
- Constant Field Values
-
ReasonZeroDurationTrades
public static final int ReasonZeroDurationTradesThe Constant ReasonZeroDurationTrades.- See Also:
- Constant Field Values
-
ReasonTooManyOpenTrades
public static final int ReasonTooManyOpenTradesThe Constant ReasonTooManyOpenTrades.- See Also:
- Constant Field Values
-
ReasonTooLongTrade
public static final int ReasonTooLongTradeThe Constant ReasonTooLongTrade.- See Also:
- Constant Field Values
-
ReasonNoFilledTrades
public static final int ReasonNoFilledTradesThe Constant ReasonNoFilledTrades.- See Also:
- Constant Field Values
-
ReasonOutlierTrade
public static final int ReasonOutlierTradeThe Constant ReasonOutlierTrade.- See Also:
- Constant Field Values
-
ReasonAmbiguousTrades
public static final int ReasonAmbiguousTradesThe Constant ReasonAmbiguousTrades.- See Also:
- Constant Field Values
-
ReasonThreshold
public static final int ReasonThresholdThe Constant ReasonThreshold.- See Also:
- Constant Field Values
-
ReasonBacktestException
public static final int ReasonBacktestExceptionThe Constant ReasonBacktestException.- See Also:
- Constant Field Values
-
ReasonStopped
public static final int ReasonStoppedThe Constant ReasonStopped.- See Also:
- Constant Field Values
-
ReasonExceptionEvaluatingConditions
public static final int ReasonExceptionEvaluatingConditionsThe Constant ReasonExceptionEvaluatingConditions.- See Also:
- Constant Field Values
-
ReasonCrossCheckException
public static final int ReasonCrossCheckExceptionThe Constant ReasonCrossCheckException.- See Also:
- Constant Field Values
-
ReasonInitialPopulation
public static final int ReasonInitialPopulationThe Constant ReasonInitialPopulation.- See Also:
- Constant Field Values
-
ReasonStrategyTooSimilar
public static final int ReasonStrategyTooSimilarThe Constant ReasonStrategyTooSimilar.- See Also:
- Constant Field Values
-
ReasonReplacedWithBetterStrategy
public static final int ReasonReplacedWithBetterStrategyThe Constant ReasonReplacedWithBetterStrategy.- See Also:
- Constant Field Values
-
ReasonOptProfileProfitableOptimizations
public static final int ReasonOptProfileProfitableOptimizationsThe Constant ReasonOptProfileProfitableOptimizations.- See Also:
- Constant Field Values
-
ReasonOptProfileAvgProfit
public static final int ReasonOptProfileAvgProfitThe Constant ReasonOptProfileAvgProfit.- See Also:
- Constant Field Values
-
ReasonOptProfileUniformDistribution
public static final int ReasonOptProfileUniformDistributionThe Constant ReasonOptProfileUniformDistribution.- See Also:
- Constant Field Values
-
ReasonOptProfileBestOptimizationProfit
public static final int ReasonOptProfileBestOptimizationProfitThe Constant ReasonOptProfileBestOptimizationProfit.- See Also:
- Constant Field Values
-
ReasonAdditionalMarketsFilter
public static final int ReasonAdditionalMarketsFilterThe Constant ReasonAdditionalMarketsFilter.- See Also:
- Constant Field Values
-
ReasonWrongParamsException
public static final int ReasonWrongParamsExceptionThe Constant ReasonWrongParamsException.- See Also:
- Constant Field Values
-
ReasonCorrelationWithExistingPortfolio
public static final int ReasonCorrelationWithExistingPortfolioThe Constant CorrelationWithExistingPortfolio.- See Also:
- Constant Field Values
-
ReasonPortfolioMasterCorrelationLimitation
public static final int ReasonPortfolioMasterCorrelationLimitationThe Constant PortfolioMasterCorrelationLimitation.- See Also:
- Constant Field Values
-
ReasonPortfolioMasterSectorLimitation
public static final int ReasonPortfolioMasterSectorLimitationThe Constant PortfolioMasterSectorLimitation.- See Also:
- Constant Field Values
-
ReasonCCExceptionMCManipulation
public static final int ReasonCCExceptionMCManipulationThe Constant ReasonCCExceptionMCManipulation.- See Also:
- Constant Field Values
-
ReasonCCExceptionMCRetest
public static final int ReasonCCExceptionMCRetestThe Constant ReasonCCExceptionMCRetest.- See Also:
- Constant Field Values
-
ReasonCCExceptionOptProfileSPP
public static final int ReasonCCExceptionOptProfileSPPThe Constant ReasonCCExceptionOptProfileSPP.- See Also:
- Constant Field Values
-
ReasonCCExceptionAddMarkets
public static final int ReasonCCExceptionAddMarketsThe Constant ReasonCCExceptionAddMarkets.- See Also:
- Constant Field Values
-
ReasonCCExceptionWFMatrix
public static final int ReasonCCExceptionWFMatrixThe Constant ReasonCCExceptionWFMatrix.- See Also:
- Constant Field Values
-
ReasonCCExceptionWFOptim
public static final int ReasonCCExceptionWFOptimThe Constant ReasonCCExceptionWFOptim.- See Also:
- Constant Field Values
-
ReasonCCExceptionHigherBacktestPrecis
public static final int ReasonCCExceptionHigherBacktestPrecisThe Constant ReasonCCExceptionHigherBacktestPrecis.- See Also:
- Constant Field Values
-
ReasonCCExceptionWhatIf
public static final int ReasonCCExceptionWhatIfThe Constant ReasonCCExceptionWhatIf.- See Also:
- Constant Field Values
-
ReasonCustomAnalysisFilter
public static final int ReasonCustomAnalysisFilterThe Constant ReasonCustomAnalysisFilter.- See Also:
- Constant Field Values
-
ReasonCCExceptionSequentialOptimization
public static final int ReasonCCExceptionSequentialOptimizationThe Constant ReasonCCExceptionSequentialOptimization.- See Also:
- Constant Field Values
-
TxtShortReasonNoTrades
The Constant TxtShortReasonNoTrades. -
TxtShortReasonTooLittleTrades
The Constant TxtShortReasonTooLittleTrades. -
TxtShortReasonZeroPLTrades
The Constant TxtShortReasonZeroPLTrades. -
TxtShortReasonTooShortTrades
The Constant TxtShortReasonTooShortTrades. -
TxtShortReasonZeroDurationTrades
The Constant TxtShortReasonZeroDurationTrades. -
TxtShortReasonTooManyOpenTrades
The Constant TxtShortReasonTooManyOpenTrades. -
TxtShortReasonTooLongTrade
The Constant TxtShortReasonTooLongTrade. -
TxtShortReasonNoFilledTrades
The Constant TxtShortReasonNoFilledTrades. -
TxtShortReasonInitialPopulation
The Constant TxtShortReasonInitialPopulation. -
TxtShortReasonStrategyTooSimilar
The Constant TxtShortReasonStrategyTooSimilar. -
TxtShortReasonOutlierTrade
The Constant TxtShortReasonOutlierTrade. -
TxtShortReasonAmbiguousTrades
The Constant TxtShortReasonAmbiguousTrades. -
TxtShortReplacedWithBetterStrategy
The Constant TxtShortReplacedWithBetterStrategy. -
TxtShortOptProfileProfitableOptimizations
The Constant TxtShortOptProfileProfitableOptimizations. -
TxtShortOptProfileAvgProfit
The Constant TxtShortOptProfileAvgProfit. -
TxtShortOptProfileUniformDistribution
The Constant TxtShortOptProfileUniformDistribution. -
TxtShortOptProfileBestOptimizationProfit
The Constant TxtShortOptProfileBestOptimizationProfit. -
TxtShorAdditionalMarketsFilter
The Constant TxtShorAdditionalMarketsFilter. -
TxtLongReasonNoTrades
The Constant TxtLongReasonNoTrades. -
TxtLongReasonTooLittleTrades
The Constant TxtLongReasonTooLittleTrades. -
TxtLongReasonZeroPLTrades
The Constant TxtLongReasonZeroPLTrades. -
TxtLongReasonTooShortTrades
The Constant TxtLongReasonTooShortTrades. -
TxtLongReasonZeroDurationTrades
The Constant TxtLongReasonZeroDurationTrades. -
TxtLongReasonTooManyOpenTrades
The Constant TxtLongReasonTooManyOpenTrades. -
TxtLongReasonTooLongTrade
The Constant TxtLongReasonTooLongTrade. -
TxtLongReasonNoFilledTrades
The Constant TxtLongReasonNoFilledTrades. -
TxtLongReasonInitialPopulation
The Constant TxtLongReasonInitialPopulation. -
TxtLongReasonStrategyTooSimilar
The Constant TxtLongReasonStrategyTooSimilar. -
TxtLongReasonOutlierTrade
The Constant TxtLongReasonOutlierTrade. -
TxtLongReasonAmbiguousTrades
The Constant TxtLongReasonAmbiguousTrades. -
TxtLongReplacedWithBetterStrategy
The Constant TxtLongReplacedWithBetterStrategy. -
TxtLongOptProfileProfitableOptimizations
The Constant TxtLongOptProfileProfitableOptimizations. -
TxtLongOptProfileAvgProfit
The Constant TxtLongOptProfileAvgProfit. -
TxtLongOptProfileUniformDistribution
The Constant TxtLongOptProfileUniformDistribution. -
TxtLongOptProfileBestOptimizationProfit
The Constant TxtLongOptProfileBestOptimizationProfit. -
TxtLongAdditionalMarketsFilter
The Constant TxtLongAdditionalMarketsFilter. -
TxtReasonCCExceptionMCManipulation
The Constant TxtReasonCCExceptionMCManipulation. -
TxtReasonCCExceptionMCRetest
The Constant TxtReasonCCExceptionMCRetest. -
TxtReasonCCExceptionOptProfileSPP
The Constant TxtReasonCCExceptionOptProfileSPP. -
TxtReasonCCExceptionAddMarkets
The Constant TxtReasonCCExceptionAddMarkets. -
TxtReasonCCExceptionWFMatrix
The Constant TxtReasonCCExceptionWFMatrix. -
TxtReasonCCExceptionWFOptim
The Constant TxtReasonCCExceptionWFOptim. -
TxtReasonCCExceptionSequentialOptimization
The Constant TxtReasonCCExceptionChainOptimization. -
TxtReasonCCExceptionHigherBacktestPrecis
The Constant TxtReasonCCExceptionHigherBacktestPrecis. -
TxtCorrelationWithExistingPortfolio
The Constant TxtCorrelationWithExistingPortfolio. -
TxtPortfolioMasterCorrelationLimitation
The Constant TxtPortfolioMasterCorrelationLimitation. -
TxtPortfolioMasterSectorLimitation
The Constant TxtPortfolioMasterSectorLimitation. -
PrefixInitialConditions
public static final int PrefixInitialConditionsThe Constant PrefixInitialConditions.- See Also:
- Constant Field Values
-
PrefixNormalConditions
public static final int PrefixNormalConditionsThe Constant PrefixNormalConditions.- See Also:
- Constant Field Values
-
PrefixCrossCheckConditions
public static final int PrefixCrossCheckConditionsThe Constant PrefixCrossCheckConditions.- See Also:
- Constant Field Values
-
ExplanationUnknown
The Constant ExplanationUnknown. -
ReplacedWorseStrategy
The Constant ReplacedWorseStrategy.- See Also:
- Constant Field Values
-
ReasonStockpickerShiftChanged
public static final int ReasonStockpickerShiftChangedThe Constant ReasonStockpickerShiftChanged.- See Also:
- Constant Field Values
-
TxtLongReasonStockpickerShiftChanged
The Constant TxtLongReasonStockpickerShiftChanged.
-
-
Constructor Details
-
BadStrategyException
public BadStrategyException(int reason)Instantiates a new bad strategy exception.- Parameters:
reason
- the reason
-
-
Method Details
-
getReason
public int getReason()Gets the reason.- Returns:
- the reason
-
getReasonAsString
Gets the reason as string.- Parameters:
reason
- the reason- Returns:
- the reason as string
-
isBadStrategyException
public static boolean isBadStrategyException(int reason)Checks if is bad strategy exception.- Parameters:
reason
- the reason- Returns:
- true, if is bad strategy exception
-
getReasonAsString
Gets the reason as string.- Returns:
- the reason as string
-
check
public static boolean check(int checkType, int reason)Check.- Parameters:
checkType
- the check typereason
- the reason- Returns:
- true, if successful
-
setOrThrow
public static int setOrThrow(int throwType, boolean warnings, int reason) throws BadStrategyExceptionSets the or throw.- Parameters:
throwType
- the throw typewarnings
- the warningsreason
- the reason- Returns:
- the int
- Throws:
BadStrategyException
- the bad strategy exception
-
getExplanation
Gets the explanation.- Parameters:
reason
- the reason- Returns:
- the explanation
-
reasonToShortText
Reason to short text.- Parameters:
reason
- the reason- Returns:
- the string
-
getSubReasons
public static it.unimi.dsi.fastutil.ints.IntArrayList getSubReasons(int dismissalReason)Gets the sub reasons.- Parameters:
dismissalReason
- the dismissal reason- Returns:
- the sub reasons
-
listProblems
List problems.- Returns:
- the array list
-
getFirstReason
public static int getFirstReason(int strategyProblems)Gets the first reason.- Parameters:
strategyProblems
- the strategy problems- Returns:
- the first reason
-
getFirstReason
public static int getFirstReason(int strategyProblems, int dismissBadStrategies)Gets the first reason.- Parameters:
strategyProblems
- the strategy problemsdismissBadStrategies
- the dismiss bad strategies- Returns:
- the first reason
-
getMessage
Gets the message.- Overrides:
getMessage
in classThrowable
- Returns:
- the message
-