Class RuntimeDescriptor

java.lang.Object
com.motivewave.platform.sdk.study.RuntimeDescriptor

public class RuntimeDescriptor extends Object
This class describes 'runtime' settings for the study.
  • Constructor Details

    • RuntimeDescriptor

      public RuntimeDescriptor()
      Creates a RuntimeDescriptor object. Note: this constructor is deprecated. Please use RuntimeDescriptor(Study study) instead.
  • Method Details

    • addPlot

      public void addPlot(String name, Plot plot)
      Adds a new plot to the study. Please note: this operation will be ignored if the study is an overlay or the name of the plot is a reserved name (ie Plot.DEFAULT or Plot.PRICE)
      Parameters:
      name -
      plot -
    • getPlot

      public Plot getPlot(String name)
      Gets the plot associated with the given name.
      Parameters:
      name -
    • getDefaultPlot

      public Plot getDefaultPlot()
      Gets the default plot. This is equivalent to getPlot(Plot.DEFAULT)
      Returns:
      default plot
    • getPricePlot

      public Plot getPricePlot()
      Gets the price plot. This is equivalent to getPlot(Plot.PRICE)
      Returns:
      price plot
    • isPricePlotRequired

      public boolean isPricePlotRequired()
      Indicates that the price plot is required for this study.
      Returns:
      true if the price plot is required for this study
    • setPricePlotRequired

      public void setPricePlotRequired(boolean b)
      Sets the required attribute for the price plot.
      Parameters:
      b - true if the price plot is required
    • getPlotKeys

      public Set<String> getPlotKeys()
      Gets the set of plot keys registered to this study.
      Returns:
      set of plot keys registered to this study
    • clearExportedValues

      public void clearExportedValues()
    • exportValue

      public void exportValue(ValueDescriptor desc)
      Exports a value so that it may be used outside of the context of the study. Exported values may be used as:
      1. Cursor Data - displayed in the Cursor Data Window
      2. Input for another Study - Studies may be created with values from other studies.
      3. Scanner parameters - The Study Scanner may use these values as conditions.
      4. Alerts - Alerts may be triggered using these values.
      Parameters:
      desc - describes the exported value
    • getExportedValue

      public ValueDescriptor getExportedValue(Object key)
      Gets the exported value associated with the given key.
      Parameters:
      key -
      Returns:
      export value associated with the given key
    • getExportedValues

      public List<ValueDescriptor> getExportedValues()
      Gets the list of exported values.
      Returns:
      list of exported values
    • findExportedValue

      public ValueDescriptor findExportedValue(String keyString)
      Finds the exported value using a string key.
      Parameters:
      keyString -
      Returns:
      exported value using the string key
    • declareSignal

      public void declareSignal(Object key, String label)
      Declare a signal with the given key and user readable string.
      Parameters:
      key -
      label -
    • getSignals

      public List<SignalDescriptor> getSignals()
      Gets the list of signals generated by this study.
      Returns:
      list of signals generated by this study
    • getSignal

      public SignalDescriptor getSignal(Object key)
      Gets the signal associated with the given key.
      Parameters:
      key -
      Returns:
      signal associated with the given key
    • isRangeOrRenkoOnly

      public boolean isRangeOrRenkoOnly()
      Returns true if this study if only for Range or Renko bars.
      Returns:
      true if this study is only for Range or Renko bars.
    • setRangeOrRenkoOnly

      public void setRangeOrRenkoOnly(boolean b)
      Use this method to set a study to be used with Range or Renko bars only.
      Parameters:
      b - true if this study is only for Range or Renko bars.
    • setLabelSettings

      public void setLabelSettings(String... vals)
      Use this method to identify which settings should be part of the default plot label (and to identify the study).
    • getLabelSettings

      public List<String> getLabelSettings()
      Gets the label settings for the default plot.
      Returns:
      label settings for the default plot
    • setIDSettings

      public void setIDSettings(String... vals)
      Use this method to identify which settings should be part of the default plot identifier. By default, the label settings will be used. Use this to override the label settings.
      Parameters:
      vals - ID setting values
    • getIDSettings

      public List<String> getIDSettings()
      Gets the set of settings that are part of the ID for the default plot. By default, this will return the label settings.
      Returns:
      set of ID settings
    • getLabelPrefix

      public String getLabelPrefix()
      Gets the label prefix for the default plot. If this is empty, the label attribute from the StudyHeader will used instead.
      Returns:
      label prefix for the default plot
    • setLabelPrefix

      public void setLabelPrefix(String label)
      Sets the label prefix for the default plot. If this is not set, the label attribute from the StudyHeader will be used instead.
      Parameters:
      label - label prefix
    • getTabName

      public String getTabName()
      Gets the tab name for the default plot. If this is empty, the label attribute from the StudyHeader will used instead.
      Returns:
      tab name for the default plot
    • setTabName

      public void setTabName(String label)
      Sets the tab name. If this is not set, the label attribute from the StudyHeader will be used instead.
      Parameters:
      label - tab name label
    • setRangeKeys

      public void setRangeKeys(Object... keys)
      Use this method to identify the numeric values generated by this study that are to affect the vertical range of the default plot (when auto scale is turned on).
    • getRangeKeys

      public List<Object> getRangeKeys()
      Gets the range keys for the default plot.
      Returns:
      list of range keys for the default plot
    • declarePath

      public void declarePath(Object valueKey, String pathSettingsKey)
      Declare a path associated with the given value key for the default plot. Settings for the path are resolved using the pathSettingsKey. At runtime a path will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey - unique identifier for the value
      pathSettingsKey - settings key of the path
    • declarePriceBar

      public void declarePriceBar(Object valueKey, String settingsKey)
      Declare a price bar associated with the given value key for the default plot. Settings for the price bars are resolved using the settingsKey. At runtime a series of price bars will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey - unique identifier for the value
      settingsKey - settings key of the path
    • setValueSeries

      public void setValueSeries(Object valueKey, Object barSizeOrSettingsKey)
      Sets the data series for the value key. By default values are pulled from the primary data series Setting this will cause the framework to load values from a different data series.
      Parameters:
      valueKey - unique identifier for the value
      barSizeOrSettingsKey - bar size of the data series, null for the primary data series. Alternatively specify a settings key that points to a BarSizeDescriptor. This will dynamically choose the bar size
    • getValueSeries

      public Object getValueSeries(Object valueKey)
      Gets the data series for the value key. If null is returned the primary data series will be used.
      Parameters:
      valueKey - unique identifier for the value
    • declareIndicator

      public void declareIndicator(Object valueKey, String indicatorKey)
      Associates a value key to an indicator on the default plot.
      Parameters:
      valueKey -
      indicatorKey -
    • declareBars

      public void declareBars(Object valueKey, String settingsKey)
      Declare a bar sequence associated with the given value key for the default plot. Settings for the bars are resolved using the pathSettingsKey. At runtime a set of bars will be drawn (if enabled) using the values defined by the valueKey.
      Parameters:
      valueKey -
      settingsKey -
    • declareBars

      public void declareBars(Object valueKey)
      Declare bar sequence on the default plot using the default settings for drawing bars.
      Parameters:
      valueKey -
    • addHorizontalLine

      public void addHorizontalLine(LineInfo info)
      Adds a horizontal line to the default plot using the information defined in LineInfo.
      Parameters:
      info - line info object
    • clearHorizontalLines

      public void clearHorizontalLines()
      Removes all of the horizontal lines.
    • getTopInsetPixels

      public int getTopInsetPixels()
      Gets the top inset for the default plot (in pixels).
      Returns:
      top inset for the default plot
    • setTopInsetPixels

      public void setTopInsetPixels(int pixels)
      Sets the top inset for the default plot (in pixels).
      Parameters:
      pixels -
    • getBottomInsetPixels

      public int getBottomInsetPixels()
      Gets the bottom inset for the default plot (in pixels).
      Returns:
      bottom inset for the default plot
    • setBottomInsetPixels

      public void setBottomInsetPixels(int pixels)
      Sets the bottom inset for the default plot (in pixels).
      Parameters:
      pixels -
    • getFixedBottomValue

      public Integer getFixedBottomValue()
      Gets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the default plot (bottom of the vertical axis).
      Returns:
      fixed bottom value
    • setFixedBottomValue

      public void setFixedBottomValue(Integer value)
      Sets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the default plot (bottom of the vertical axis).
      Parameters:
      value - fixed bottom value
    • getFixedTopValue

      public Integer getFixedTopValue()
      Gets the 'fixed' top value (null if not defined). This value is used to determine the range of the default plot (top of the vertical axis).
      Returns:
      fixed top value
    • setFixedTopValue

      public void setFixedTopValue(Integer value)
      Sets the 'fixed' top value (null if not defined). This value is used to determine the range of the default plot (top of the vertical axis).
      Parameters:
      value -
    • getMaxBottomValue

      public Integer getMaxBottomValue()
      Gets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the default plot (bottom of the vertical axis).
      Returns:
      maximum bottom value
    • setMaxBottomValue

      public void setMaxBottomValue(Integer max)
      Sets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the default plot (bottom of the vertical axis).
      Parameters:
      max - maximum bottom value
    • getMinTopValue

      public Integer getMinTopValue()
      Gets the 'minimum' top value (null if not defined). This value is used to determine the range of the default plot (top of the vertical axis).
    • setMinTopValue

      public void setMinTopValue(Integer v)
      Sets the 'minimum' top value (null if not defined). This value is used to determine the range of the default plot (top of the vertical axis).
    • getMinTick

      public Double getMinTick()
      Gets the minimum tick value for the vertical axis of the default plot (if this is not an overlay). Null is return if this value should be calculated automatically
      Returns:
      minimum tick value
    • setMinTick

      public void setMinTick(Double minTick)
      Sets the minimum tick for the vertical axis of the default plot (if this is not an overlay). Set to null (default) to automatically detect the minimum value.
      Parameters:
      minTick - minimum tick value
    • getHorizontalLines

      public List<LineInfo> getHorizontalLines()
      Gets the list of horizontal lines declared for the default plot.
      Returns:
      list of horizontal lines for the default plot
    • getPaths

      public Map<Object,String> getPaths()
      Gets the map of declared paths for the default plot. (a map of value key to settings key).
      Returns:
      map of declared paths for the default plot
    • getIndicators

      public Map<Object,String> getIndicators()
      Gets the map of declared indicators for the default plot. (a map of value key to settings key).
      Returns:
      map of declared indicators for the default plot.
    • getBars

      public Map<Object,String> getBars()
      Gets the map of declared bars for the default plot. (a map of value key to settings key).
      Returns:
      map of declared bars for the default plot.