Class DatabankColumn

java.lang.Object
com.strategyquant.tradinglib.debug.Debugger
com.strategyquant.tradinglib.table.TableColumn
com.strategyquant.tradinglib.DatabankColumn

public class DatabankColumn extends com.strategyquant.tradinglib.table.TableColumn
The Class DatabankColumn.
  • Field Details

    • valueType

      public byte valueType
      The value type.
  • Constructor Details

    • DatabankColumn

      public DatabankColumn(String columnName, String formatType, byte valueType, double target, double avgMin, double avgMax)
      Instantiates a new databank column.
      Parameters:
      columnName - the column name
      formatType - the format type
      valueType - the value type
      target - the target
      avgMin - the avg min
      avgMax - the avg max
  • Method Details

    • getTarget

      public double getTarget()
      Gets the target.
      Returns:
      the target
    • getValue

      public String getValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType) throws Exception
      Gets the value.
      Parameters:
      results - the results
      resultKey - the result key
      direction - the direction
      plType - the pl type
      sampleType - the sample type
      Returns:
      the value
      Throws:
      Exception - the exception
    • exportValue

      public String exportValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType) throws Exception
      Export value.
      Parameters:
      results - the results
      resultKey - the result key
      direction - the direction
      plType - the pl type
      sampleType - the sample type
      Returns:
      the string
      Throws:
      Exception - the exception
    • getCustomFormat

      public CustomCellFormat getCustomFormat(byte direction, byte plType, byte sampleType, String value, ResultsGroup rg)
      Gets the custom format.
      Parameters:
      direction - the direction
      plType - the pl type
      sampleType - the sample type
      value - the value
      rg - the rg
      Returns:
      the custom format
    • getNumericValue

      public double getNumericValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType) throws Exception
      Gets the numeric value.
      Parameters:
      results - the results
      resultKey - the result key
      direction - the direction
      plType - the pl type
      sampleType - the sample type
      Returns:
      the numeric value
      Throws:
      Exception - the exception
    • getStats

      public SQStats getStats(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType) throws Exception
      Gets the stats.
      Parameters:
      results - the results
      resultKey - the result key
      direction - the direction
      plType - the pl type
      sampleType - the sample type
      Returns:
      the stats
      Throws:
      Exception - the exception
    • setValue

      public boolean setValue(Object valueObject, Object value) throws Exception
      Sets the value.
      Parameters:
      valueObject - the value object
      value - the value
      Returns:
      true, if successful
      Throws:
      Exception - the exception
    • getValueType

      public byte getValueType()
      Gets the value type.
      Returns:
      the value type
    • transformToFitnessRange

      public double transformToFitnessRange(double value, double target, byte passedValueType)
      Transform to fitness range.
      Parameters:
      value - the value
      target - the target
      Returns:
      the double
    • transformToFitnessRange

      public static double transformToFitnessRange(double value, double target, double avgMin, double avgMax, byte valueType)
      Transform to fitness range.
      Parameters:
      value - the value
      target - the target
      avgMin - the avg min
      avgMax - the avg max
      valueType - the value type
      Returns:
      the double
    • compute

      public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort, Result result, SettingsMap rgSpecialValues) throws Exception
      Compute for order.
      Parameters:
      stats - the stats
      combination - the combination
      ordersList - the orders list
      settings - the settings
      statsLong - the stats long
      statsShort - the stats short
      result - the result
      rgSpecialValues - the rg special values
      Returns:
      the double
      Throws:
      Exception - the exception
    • compute

      public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort, Result result) throws Exception
      Compute.
      Parameters:
      stats - the stats
      combination - the combination
      ordersList - the orders list
      settings - the settings
      statsLong - the stats long
      statsShort - the stats short
      Returns:
      the double
      Throws:
      Exception - the exception
    • compute

      public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort) throws Exception
      Compute.
      Parameters:
      stats - the stats
      combination - the combination
      ordersList - the orders list
      settings - the settings
      statsLong - the stats long
      statsShort - the stats short
      Returns:
      the double
      Throws:
      Exception - the exception
    • getDependencies

      public String[] getDependencies()
      Gets the dependencies.
      Returns:
      the dependencies
    • getPLTypeRestrictions

      public byte[] getPLTypeRestrictions()
      Gets the PL type restrictions.
      Returns:
      the PL type restrictions
    • getDirectionRestrictions

      public byte[] getDirectionRestrictions()
      Gets the direction restrictions.
      Returns:
      the direction restrictions
    • getClassName

      public String getClassName()
      Gets the class name.
      Returns:
      the class name
    • printHtmlFormatedValue

      public String printHtmlFormatedValue(SQStats stats) throws Exception
      Prints the html formated value.
      Parameters:
      stats - the stats
      Returns:
      the string
      Throws:
      Exception - the exception
    • convertToDoubleSafe

      public double convertToDoubleSafe(String value)
      Convert to double safe.
      Parameters:
      value - the value
      Returns:
      the double
    • isDependentOnTradingPeriod

      public boolean isDependentOnTradingPeriod()
      Checks if is dependent on trading period.
      Returns:
      true, if is dependent on trading period
    • setDependentOnTradingPeriod

      public void setDependentOnTradingPeriod(boolean dependent)
      Sets the dependent on trading period.
      Parameters:
      dependent - the new dependent on trading period
    • getCrossCheckComputedValue

      public String getCrossCheckComputedValue(ResultsGroup results, double crossCheckValue) throws Exception
      Gets the cross check computed value.
      Parameters:
      results - the results
      crossCheckValue - the cross check value
      Returns:
      the cross check computed value
      Throws:
      Exception - the exception