Class ParametersHelper

java.lang.Object
com.strategyquant.tradinglib.ParametersHelper

public class ParametersHelper extends Object
The Class ParametersHelper.
  • Field Details

    • Log

      public static final org.slf4j.Logger Log
      The Constant Log.
  • Constructor Details

    • ParametersHelper

      public ParametersHelper()
  • Method Details

    • setParameterValue

      public static void setParameterValue(IBlock block, String paramName, Object paramValue) throws BlockDefinitionException
      Sets the parameter value.
      Parameters:
      block - the block
      paramName - the param name
      paramValue - the param value
      Throws:
      BlockDefinitionException - the block definition exception
    • getParameterValue

      public static Object getParameterValue(IBlock block, String paramName) throws BlockDefinitionException
      Gets the parameter value.
      Parameters:
      block - the block
      paramName - the param name
      Returns:
      the parameter value
      Throws:
      BlockDefinitionException - the block definition exception
    • getParameters

      public static ArrayList<String> getParameters(IBlock block)
      Gets the parameters.
      Parameters:
      block - the block
      Returns:
      the parameters
    • setFieldValue

      public static void setFieldValue(IBlock block, String paramName, Object paramValue) throws BlockDefinitionException
      Sets the field value.
      Parameters:
      block - the block
      paramName - the param name
      paramValue - the param value
      Throws:
      BlockDefinitionException - the block definition exception
    • getFieldValue

      public static Object getFieldValue(IBlock block, String paramName) throws BlockDefinitionException
      Gets the field value.
      Parameters:
      block - the block
      paramName - 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 BlockDefinitionException
      Copy parameters from block to block.
      Parameters:
      sourceBlock - the source block
      targetBlock - the target block
      iParametersHelperModifier - 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 BlockDefinitionException
      Negate parameters in cloned block.
      Parameters:
      block - the block
      oppositeBlock - the opposite block
      negatersList - the negaters list
      strategy - the strategy
      Throws:
      BlockDefinitionException - the block definition exception
    • negateDataSeries

      public static void negateDataSeries(IBlock block, IBlock oppositeBlock)
      Negate data series.
      Parameters:
      block - the block
      oppositeBlock - the opposite block
    • getField

      public static int getField(Object obj, String fieldName)
    • setField

      public static void setField(Object obj, String fieldName, int value)