Class BadStrategyException

All Implemented Interfaces:
Serializable

public class BadStrategyException extends TradingException
The Class BadStrategyException.
See Also:
Serialized Form
  • Field Details

    • ReasonNoTrades

      public static final int ReasonNoTrades
      The Constant ReasonNoTrades.
      See Also:
      Constant Field Values
    • ReasonTooLittleTrades

      public static final int ReasonTooLittleTrades
      The Constant ReasonTooLittleTrades.
      See Also:
      Constant Field Values
    • ReasonZeroPLTrades

      public static final int ReasonZeroPLTrades
      The Constant ReasonZeroPLTrades.
      See Also:
      Constant Field Values
    • ReasonTooShortTrades

      public static final int ReasonTooShortTrades
      The Constant ReasonTooShortTrades.
      See Also:
      Constant Field Values
    • ReasonZeroDurationTrades

      public static final int ReasonZeroDurationTrades
      The Constant ReasonZeroDurationTrades.
      See Also:
      Constant Field Values
    • ReasonTooManyOpenTrades

      public static final int ReasonTooManyOpenTrades
      The Constant ReasonTooManyOpenTrades.
      See Also:
      Constant Field Values
    • ReasonTooLongTrade

      public static final int ReasonTooLongTrade
      The Constant ReasonTooLongTrade.
      See Also:
      Constant Field Values
    • ReasonNoFilledTrades

      public static final int ReasonNoFilledTrades
      The Constant ReasonNoFilledTrades.
      See Also:
      Constant Field Values
    • ReasonOutlierTrade

      public static final int ReasonOutlierTrade
      The Constant ReasonOutlierTrade.
      See Also:
      Constant Field Values
    • ReasonAmbiguousTrades

      public static final int ReasonAmbiguousTrades
      The Constant ReasonAmbiguousTrades.
      See Also:
      Constant Field Values
    • ReasonThreshold

      public static final int ReasonThreshold
      The Constant ReasonThreshold.
      See Also:
      Constant Field Values
    • ReasonBacktestException

      public static final int ReasonBacktestException
      The Constant ReasonBacktestException.
      See Also:
      Constant Field Values
    • ReasonStopped

      public static final int ReasonStopped
      The Constant ReasonStopped.
      See Also:
      Constant Field Values
    • ReasonExceptionEvaluatingConditions

      public static final int ReasonExceptionEvaluatingConditions
      The Constant ReasonExceptionEvaluatingConditions.
      See Also:
      Constant Field Values
    • ReasonCrossCheckException

      public static final int ReasonCrossCheckException
      The Constant ReasonCrossCheckException.
      See Also:
      Constant Field Values
    • ReasonInitialPopulation

      public static final int ReasonInitialPopulation
      The Constant ReasonInitialPopulation.
      See Also:
      Constant Field Values
    • ReasonStrategyTooSimilar

      public static final int ReasonStrategyTooSimilar
      The Constant ReasonStrategyTooSimilar.
      See Also:
      Constant Field Values
    • ReasonReplacedWithBetterStrategy

      public static final int ReasonReplacedWithBetterStrategy
      The Constant ReasonReplacedWithBetterStrategy.
      See Also:
      Constant Field Values
    • ReasonOptProfileProfitableOptimizations

      public static final int ReasonOptProfileProfitableOptimizations
      The Constant ReasonOptProfileProfitableOptimizations.
      See Also:
      Constant Field Values
    • ReasonOptProfileAvgProfit

      public static final int ReasonOptProfileAvgProfit
      The Constant ReasonOptProfileAvgProfit.
      See Also:
      Constant Field Values
    • ReasonOptProfileUniformDistribution

      public static final int ReasonOptProfileUniformDistribution
      The Constant ReasonOptProfileUniformDistribution.
      See Also:
      Constant Field Values
    • ReasonOptProfileBestOptimizationProfit

      public static final int ReasonOptProfileBestOptimizationProfit
      The Constant ReasonOptProfileBestOptimizationProfit.
      See Also:
      Constant Field Values
    • ReasonAdditionalMarketsFilter

      public static final int ReasonAdditionalMarketsFilter
      The Constant ReasonAdditionalMarketsFilter.
      See Also:
      Constant Field Values
    • ReasonWrongParamsException

      public static final int ReasonWrongParamsException
      The Constant ReasonWrongParamsException.
      See Also:
      Constant Field Values
    • ReasonCorrelationWithExistingPortfolio

      public static final int ReasonCorrelationWithExistingPortfolio
      The Constant CorrelationWithExistingPortfolio.
      See Also:
      Constant Field Values
    • ReasonCCExceptionMCManipulation

      public static final int ReasonCCExceptionMCManipulation
      The Constant ReasonCCExceptionMCManipulation.
      See Also:
      Constant Field Values
    • ReasonCCExceptionMCRetest

      public static final int ReasonCCExceptionMCRetest
      The Constant ReasonCCExceptionMCRetest.
      See Also:
      Constant Field Values
    • ReasonCCExceptionOptProfileSPP

      public static final int ReasonCCExceptionOptProfileSPP
      The Constant ReasonCCExceptionOptProfileSPP.
      See Also:
      Constant Field Values
    • ReasonCCExceptionAddMarkets

      public static final int ReasonCCExceptionAddMarkets
      The Constant ReasonCCExceptionAddMarkets.
      See Also:
      Constant Field Values
    • ReasonCCExceptionWFMatrix

      public static final int ReasonCCExceptionWFMatrix
      The Constant ReasonCCExceptionWFMatrix.
      See Also:
      Constant Field Values
    • ReasonCCExceptionWFOptim

      public static final int ReasonCCExceptionWFOptim
      The Constant ReasonCCExceptionWFOptim.
      See Also:
      Constant Field Values
    • ReasonCCExceptionHigherBacktestPrecis

      public static final int ReasonCCExceptionHigherBacktestPrecis
      The Constant ReasonCCExceptionHigherBacktestPrecis.
      See Also:
      Constant Field Values
    • ReasonCCExceptionWhatIf

      public static final int ReasonCCExceptionWhatIf
      The Constant ReasonCCExceptionWhatIf.
      See Also:
      Constant Field Values
    • ReasonCustomAnalysisFilter

      public static final int ReasonCustomAnalysisFilter
      The Constant ReasonCustomAnalysisFilter.
      See Also:
      Constant Field Values
    • ReasonCCExceptionSequentialOptimization

      public static final int ReasonCCExceptionSequentialOptimization
      The Constant ReasonCCExceptionChainOptimization.
      See Also:
      Constant Field Values
    • TxtShortReasonNoTrades

      public static final String TxtShortReasonNoTrades
      The Constant TxtShortReasonNoTrades.
    • TxtShortReasonTooLittleTrades

      public static final String TxtShortReasonTooLittleTrades
      The Constant TxtShortReasonTooLittleTrades.
    • TxtShortReasonZeroPLTrades

      public static final String TxtShortReasonZeroPLTrades
      The Constant TxtShortReasonZeroPLTrades.
    • TxtShortReasonTooShortTrades

      public static final String TxtShortReasonTooShortTrades
      The Constant TxtShortReasonTooShortTrades.
    • TxtShortReasonZeroDurationTrades

      public static final String TxtShortReasonZeroDurationTrades
      The Constant TxtShortReasonZeroDurationTrades.
    • TxtShortReasonTooManyOpenTrades

      public static final String TxtShortReasonTooManyOpenTrades
      The Constant TxtShortReasonTooManyOpenTrades.
    • TxtShortReasonTooLongTrade

      public static final String TxtShortReasonTooLongTrade
      The Constant TxtShortReasonTooLongTrade.
    • TxtShortReasonNoFilledTrades

      public static final String TxtShortReasonNoFilledTrades
      The Constant TxtShortReasonNoFilledTrades.
    • TxtShortReasonInitialPopulation

      public static final String TxtShortReasonInitialPopulation
      The Constant TxtShortReasonInitialPopulation.
    • TxtShortReasonStrategyTooSimilar

      public static final String TxtShortReasonStrategyTooSimilar
      The Constant TxtShortReasonStrategyTooSimilar.
    • TxtShortReasonOutlierTrade

      public static final String TxtShortReasonOutlierTrade
      The Constant TxtShortReasonOutlierTrade.
    • TxtShortReasonAmbiguousTrades

      public static final String TxtShortReasonAmbiguousTrades
      The Constant TxtShortReasonAmbiguousTrades.
    • TxtShortReplacedWithBetterStrategy

      public static final String TxtShortReplacedWithBetterStrategy
      The Constant TxtShortReplacedWithBetterStrategy.
    • TxtShortOptProfileProfitableOptimizations

      public static final String TxtShortOptProfileProfitableOptimizations
      The Constant TxtShortOptProfileProfitableOptimizations.
    • TxtShortOptProfileAvgProfit

      public static final String TxtShortOptProfileAvgProfit
      The Constant TxtShortOptProfileAvgProfit.
    • TxtShortOptProfileUniformDistribution

      public static final String TxtShortOptProfileUniformDistribution
      The Constant TxtShortOptProfileUniformDistribution.
    • TxtShortOptProfileBestOptimizationProfit

      public static final String TxtShortOptProfileBestOptimizationProfit
      The Constant TxtShortOptProfileBestOptimizationProfit.
    • TxtShorAdditionalMarketsFilter

      public static final String TxtShorAdditionalMarketsFilter
      The Constant TxtShorAdditionalMarketsFilter.
    • TxtLongReasonNoTrades

      public static final String TxtLongReasonNoTrades
      The Constant TxtLongReasonNoTrades.
    • TxtLongReasonTooLittleTrades

      public static final String TxtLongReasonTooLittleTrades
      The Constant TxtLongReasonTooLittleTrades.
    • TxtLongReasonZeroPLTrades

      public static final String TxtLongReasonZeroPLTrades
      The Constant TxtLongReasonZeroPLTrades.
    • TxtLongReasonTooShortTrades

      public static final String TxtLongReasonTooShortTrades
      The Constant TxtLongReasonTooShortTrades.
    • TxtLongReasonZeroDurationTrades

      public static final String TxtLongReasonZeroDurationTrades
      The Constant TxtLongReasonZeroDurationTrades.
    • TxtLongReasonTooManyOpenTrades

      public static final String TxtLongReasonTooManyOpenTrades
      The Constant TxtLongReasonTooManyOpenTrades.
    • TxtLongReasonTooLongTrade

      public static final String TxtLongReasonTooLongTrade
      The Constant TxtLongReasonTooLongTrade.
    • TxtLongReasonNoFilledTrades

      public static final String TxtLongReasonNoFilledTrades
      The Constant TxtLongReasonNoFilledTrades.
    • TxtLongReasonInitialPopulation

      public static final String TxtLongReasonInitialPopulation
      The Constant TxtLongReasonInitialPopulation.
    • TxtLongReasonStrategyTooSimilar

      public static final String TxtLongReasonStrategyTooSimilar
      The Constant TxtLongReasonStrategyTooSimilar.
    • TxtLongReasonOutlierTrade

      public static final String TxtLongReasonOutlierTrade
      The Constant TxtLongReasonOutlierTrade.
    • TxtLongReasonAmbiguousTrades

      public static final String TxtLongReasonAmbiguousTrades
      The Constant TxtLongReasonAmbiguousTrades.
    • TxtLongReplacedWithBetterStrategy

      public static final String TxtLongReplacedWithBetterStrategy
      The Constant TxtLongReplacedWithBetterStrategy.
    • TxtLongOptProfileProfitableOptimizations

      public static final String TxtLongOptProfileProfitableOptimizations
      The Constant TxtLongOptProfileProfitableOptimizations.
    • TxtLongOptProfileAvgProfit

      public static final String TxtLongOptProfileAvgProfit
      The Constant TxtLongOptProfileAvgProfit.
    • TxtLongOptProfileUniformDistribution

      public static final String TxtLongOptProfileUniformDistribution
      The Constant TxtLongOptProfileUniformDistribution.
    • TxtLongOptProfileBestOptimizationProfit

      public static final String TxtLongOptProfileBestOptimizationProfit
      The Constant TxtLongOptProfileBestOptimizationProfit.
    • TxtLongAdditionalMarketsFilter

      public static final String TxtLongAdditionalMarketsFilter
      The Constant TxtLongAdditionalMarketsFilter.
    • TxtReasonCCExceptionMCManipulation

      public static final String TxtReasonCCExceptionMCManipulation
      The Constant TxtReasonCCExceptionMCManipulation.
    • TxtReasonCCExceptionMCRetest

      public static final String TxtReasonCCExceptionMCRetest
      The Constant TxtReasonCCExceptionMCRetest.
    • TxtReasonCCExceptionOptProfileSPP

      public static final String TxtReasonCCExceptionOptProfileSPP
      The Constant TxtReasonCCExceptionOptProfileSPP.
    • TxtReasonCCExceptionAddMarkets

      public static final String TxtReasonCCExceptionAddMarkets
      The Constant TxtReasonCCExceptionAddMarkets.
    • TxtReasonCCExceptionWFMatrix

      public static final String TxtReasonCCExceptionWFMatrix
      The Constant TxtReasonCCExceptionWFMatrix.
    • TxtReasonCCExceptionWFOptim

      public static final String TxtReasonCCExceptionWFOptim
      The Constant TxtReasonCCExceptionWFOptim.
    • TxtReasonCCExceptionSequentialOptimization

      public static final String TxtReasonCCExceptionSequentialOptimization
      The Constant TxtReasonCCExceptionChainOptimization.
    • TxtReasonCCExceptionHigherBacktestPrecis

      public static final String TxtReasonCCExceptionHigherBacktestPrecis
      The Constant TxtReasonCCExceptionHigherBacktestPrecis.
    • TxtCorrelationWithExistingPortfolio

      public static final String TxtCorrelationWithExistingPortfolio
      The Constant TxtCorrelationWithExistingPortfolio.
    • PrefixInitialConditions

      public static final int PrefixInitialConditions
      The Constant PrefixInitialConditions.
      See Also:
      Constant Field Values
    • PrefixNormalConditions

      public static final int PrefixNormalConditions
      The Constant PrefixNormalConditions.
      See Also:
      Constant Field Values
    • PrefixCrossCheckConditions

      public static final int PrefixCrossCheckConditions
      The Constant PrefixCrossCheckConditions.
      See Also:
      Constant Field Values
    • ExplanationUnknown

      public static final String ExplanationUnknown
      The Constant ExplanationUnknown.
    • ReplacedWorseStrategy

      public static final String ReplacedWorseStrategy
      The Constant ReplacedWorseStrategy.
      See Also:
      Constant Field Values
  • 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

      public static String getReasonAsString(int reason)
      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

      public String 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 type
      reason - the reason
      Returns:
      true, if successful
    • setOrThrow

      public static int setOrThrow(int throwType, boolean warnings, int reason) throws BadStrategyException
      Sets the or throw.
      Parameters:
      throwType - the throw type
      warnings - the warnings
      reason - the reason
      Returns:
      the int
      Throws:
      BadStrategyException - the bad strategy exception
    • getExplanation

      public static String getExplanation(int reason)
      Gets the explanation.
      Parameters:
      reason - the reason
      Returns:
      the explanation
    • reasonToShortText

      public static String reasonToShortText(int reason)
      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

      public static ArrayList<com.strategyquant.tradinglib.exception.StrategyProblem> 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 problems
      dismissBadStrategies - the dismiss bad strategies
      Returns:
      the first reason
    • getMessage

      public String getMessage()
      Gets the message.
      Overrides:
      getMessage in class Throwable
      Returns:
      the message