Package com.strategyquant.tradinglib
Class ParametersHelper
java.lang.Object
com.strategyquant.tradinglib.ParametersHelper
The Class ParametersHelper.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyParametersFromBlockToBlock(IBlock sourceBlock, IBlock targetBlock, IParametersHelperModifier iParametersHelperModifier)
Copy parameters from block to block.static int
static Object
getFieldValue(IBlock block, String paramName)
Gets the field value.getParameters(IBlock block)
Gets the parameters.static Object
getParameterValue(IBlock block, String paramName)
Gets the parameter value.static void
negateDataSeries(IBlock block, IBlock oppositeBlock)
Negate data series.static void
negateParametersInClonedBlock(IBlock block, IBlock oppositeBlock, NegatersList negatersList, StrategyBase strategy)
Negate parameters in cloned block.static void
static void
setFieldValue(IBlock block, String paramName, Object paramValue)
Sets the field value.static void
setParameterValue(IBlock block, String paramName, Object paramValue)
Sets the parameter value.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log.
-
-
Constructor Details
-
ParametersHelper
public ParametersHelper()
-
-
Method Details
-
setParameterValue
public static void setParameterValue(IBlock block, String paramName, Object paramValue) throws BlockDefinitionExceptionSets the parameter value.- Parameters:
block
- the blockparamName
- the param nameparamValue
- the param value- Throws:
BlockDefinitionException
- the block definition exception
-
getParameterValue
public static Object getParameterValue(IBlock block, String paramName) throws BlockDefinitionExceptionGets the parameter value.- Parameters:
block
- the blockparamName
- the param name- Returns:
- the parameter value
- Throws:
BlockDefinitionException
- the block definition exception
-
getParameters
Gets the parameters.- Parameters:
block
- the block- Returns:
- the parameters
-
setFieldValue
public static void setFieldValue(IBlock block, String paramName, Object paramValue) throws BlockDefinitionExceptionSets the field value.- Parameters:
block
- the blockparamName
- the param nameparamValue
- the param value- Throws:
BlockDefinitionException
- the block definition exception
-
getFieldValue
Gets the field value.- Parameters:
block
- the blockparamName
- the param name- Returns:
- the field value
- Throws:
BlockDefinitionException
- the block definition exception
-
copyParametersFromBlockToBlock
public static void copyParametersFromBlockToBlock(IBlock sourceBlock, IBlock targetBlock, IParametersHelperModifier iParametersHelperModifier) throws BlockDefinitionExceptionCopy parameters from block to block.- Parameters:
sourceBlock
- the source blocktargetBlock
- the target blockiParametersHelperModifier
- the i parameters helper modifier- Throws:
BlockDefinitionException
- the block definition exception
-
negateParametersInClonedBlock
public static void negateParametersInClonedBlock(IBlock block, IBlock oppositeBlock, NegatersList negatersList, StrategyBase strategy) throws BlockDefinitionExceptionNegate parameters in cloned block.- Parameters:
block
- the blockoppositeBlock
- the opposite blocknegatersList
- the negaters liststrategy
- the strategy- Throws:
BlockDefinitionException
- the block definition exception
-
negateDataSeries
Negate data series.- Parameters:
block
- the blockoppositeBlock
- the opposite block
-
getField
-
setField
-