Package com.strategyquant.tradinglib
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.
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.strategyquant.tradinglib.table.TableColumn
currencySymbol, Decimal2, Decimal2Pct, Decimal2Pips, Decimal2PL, Decimal4, Decimal5, HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_LEFT, HORIZONTAL_ALIGNMENT_RIGHT, Integer, NOT_AVAILABLE, Text, Time
-
Constructor Summary
ConstructorDescriptionDatabankColumn(String columnName, String formatType, byte valueType, double target, double avgMin, double avgMax)
Instantiates a new databank column. -
Method Summary
Modifier and TypeMethodDescriptiondouble
compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort)
Compute.double
compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort, Result result)
Compute.double
compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort, Result result, SettingsMap rgSpecialValues)
Compute for order.double
convertToDoubleSafe(String value)
Convert to double safe.exportValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType)
Export value.Gets the class name.getCrossCheckComputedValue(ResultsGroup results, double crossCheckValue)
Gets the cross check computed value.getCustomFormat(byte direction, byte plType, byte sampleType, String value, ResultsGroup rg)
Gets the custom format.String[]
Gets the dependencies.byte[]
Gets the direction restrictions.double
getNumericValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType)
Gets the numeric value.byte[]
Gets the PL type restrictions.getStats(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType)
Gets the stats.double
Gets the target.getValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType)
Gets the value.byte
Gets the value type.boolean
Checks if is dependent on trading period.printHtmlFormatedValue(SQStats stats)
Prints the html formated value.void
setDependentOnTradingPeriod(boolean dependent)
Sets the dependent on trading period.boolean
Sets the value.double
transformToFitnessRange(double value, double target, byte passedValueType)
Transform to fitness range.static double
transformToFitnessRange(double value, double target, double avgMin, double avgMax, byte valueType)
Transform to fitness range.Methods inherited from class com.strategyquant.tradinglib.table.TableColumn
getName, getNumericValue, getStatsValueName, getType, getWidth, isEditable, isFontBold, isSpecialValue, printPlValue, printPlValue, printsSpecialValue, printValue, setEditable, setName, setTooltip, setWidth
Methods inherited from class com.strategyquant.tradinglib.debug.Debugger
debug, fdebug
-
Field Details
-
valueType
public byte valueTypeThe 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 nameformatType
- the format typevalueType
- the value typetarget
- the targetavgMin
- the avg minavgMax
- 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 ExceptionGets the value.- Parameters:
results
- the resultsresultKey
- the result keydirection
- the directionplType
- the pl typesampleType
- 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 ExceptionExport value.- Parameters:
results
- the resultsresultKey
- the result keydirection
- the directionplType
- the pl typesampleType
- 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 directionplType
- the pl typesampleType
- the sample typevalue
- the valuerg
- the rg- Returns:
- the custom format
-
getNumericValue
public double getNumericValue(ResultsGroup results, String resultKey, byte direction, byte plType, byte sampleType) throws ExceptionGets the numeric value.- Parameters:
results
- the resultsresultKey
- the result keydirection
- the directionplType
- the pl typesampleType
- 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 ExceptionGets the stats.- Parameters:
results
- the resultsresultKey
- the result keydirection
- the directionplType
- the pl typesampleType
- the sample type- Returns:
- the stats
- Throws:
Exception
- the exception
-
setValue
Sets the value.- Parameters:
valueObject
- the value objectvalue
- 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 valuetarget
- 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 valuetarget
- the targetavgMin
- the avg minavgMax
- the avg maxvalueType
- 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 ExceptionCompute for order.- Parameters:
stats
- the statscombination
- the combinationordersList
- the orders listsettings
- the settingsstatsLong
- the stats longstatsShort
- the stats shortresult
- the resultrgSpecialValues
- 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 ExceptionCompute.- Parameters:
stats
- the statscombination
- the combinationordersList
- the orders listsettings
- the settingsstatsLong
- the stats longstatsShort
- 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 ExceptionCompute.- Parameters:
stats
- the statscombination
- the combinationordersList
- the orders listsettings
- the settingsstatsLong
- the stats longstatsShort
- the stats short- Returns:
- the double
- Throws:
Exception
- the exception
-
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
Gets the class name.- Returns:
- the class name
-
printHtmlFormatedValue
Prints the html formated value.- Parameters:
stats
- the stats- Returns:
- the string
- Throws:
Exception
- the exception
-
convertToDoubleSafe
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 ExceptionGets the cross check computed value.- Parameters:
results
- the resultscrossCheckValue
- the cross check value- Returns:
- the cross check computed value
- Throws:
Exception
- the exception
-