Class Plot
java.lang.Object
com.motivewave.platform.sdk.study.Plot
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHorizontalLine(LineInfo info) Adds a horizontal line to the graph using the information defined in LineInfo.voidClears the declared bars.voidClears the declared guides.voidRemoves all of the horizontal lines.voidClears the declared indicators.voidClears the declared paths.voidClears the declared price bars.clone()Creates a clone (copy) of this object.voiddeclareBars(Object valueKey) Declare bar sequence using the default settings for drawing bars.voiddeclareBars(Object valueKey, String settingsKey) Declare a bar sequence associated with the given value key.voiddeclareGuide(String settingsKey) Declare a guide to be displayed on this plot.voiddeclareIndicator(Object valueKey, String indicatorKey) Associates a value key to an indicator.voiddeclarePath(Object valueKey, String pathSettingsKey) Declare a path associated with the given value key.voiddeclarePriceBar(Object valueKey, String priceBarKey) Declare a price bar associated with the given value key.getBars()Gets the set of declared bars (a map of value key to settings key).intGets the bottom inset for the graph (in pixels).Gets the 'fixed' bottom value (null if not defined).Gets the 'fixed' top value (null if not defined).Gets the set of declared guides (a map of value key to settings key).Gets the list of horizontal lines declared for this plot.Gets the set of settings that are part of the ID for the plot.Gets the set of declared indicators (a map of value key to settings key).Gets the instrument for this plot, null if the plot is not plotting instrument prices.Gets the label prefix.Gets the set of settings that are part of the label for the plot.Gets the 'maximum' bottom value (null if not defined).Gets the minimum tick value for the vertical axis (if this is not an overlay).Gets the 'minimum' top value (null if not defined).getName()Gets the name of this plot (human readable).getPaths()Gets the set of declared paths (a map of value key to settings key).Gets the set of declared price bars (a map of value key to settings key).Gets the keys of the values used to affect the vertical range of the plot.Gets the name to display in the tab for this plot.intGets the top inset for the graph (in pixels).booleanDetermines if the user is allowed to disable (hide) this plot.booleanDetermines if the user is allowed to modify insets for this study (non-overlays only, true by default).booleanDetermines if this plot is enabled.booleanDetermines if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).booleanDetermins if the labe should be shown for this plot.voidsetAllowDisable(boolean b) Sets the the ability for the user to disable (hide) this plot.voidsetAllowInsetModification(boolean b) Sets the flag for determining if the user can modify the insets for this study (non-overlays only).voidsetBottomInsetPixels(int pixels) Sets the bottom inset for the graph (in pixels).voidsetEnabled(boolean b) Sets the flag for enabling this plot.voidsetFixedBottomValue(Integer value) Sets the 'fixed' bottom value (null if not defined).voidsetFixedTopValue(Integer value) Sets the 'fixed' top value (null if not defined).voidsetFormatMK(boolean b) Sets the flag for formatting shortened version of values (ie: 10000 is 10K, 10000000 is 10M).voidsetIDSettings(String... vals) Use this method to identify which settings should be part of the plot identifier.voidsetInstrument(Instrument instrument) Sets the instrument for this plot, null if the plot is not plotting instrument prices.voidsetLabelPrefix(String label) Sets the label prefix for this plot.voidsetLabelSettings(String... vals) Use this method to identify which settings should be part of the plot label (and to identify the study).voidsetMaxBottomValue(Integer value) Sets the 'maximum' bottom value (null if not defined).voidsetMinTick(Double minTick) Sets the minimum tick for the vertical axis (if this is not an overlay).voidsetMinTopValue(Integer value) Sets the 'minimum' top value (null if not defined).voidSets the name of this plot (human readable).voidsetRangeKeys(Object... keys) Use this method to identify the numeric values generated by this study that are to affect the vertical range of the plot (when auto scale is turned on).voidsetShowLabel(boolean b) Sets the flag for showing the label for this plot.voidsetTabName(String name) Sets the name to display in the tab for this plot.voidsetTopInsetPixels(int pixels) Sets the top inset for the graph (in pixels).
-
Field Details
-
PRICE
Plot for the Price Graph. This may be used for overlays. Note: If the study is an overlay, this will be the default plot.- See Also:
-
DEFAULT
Default plot for studies that are not overlays. If the study is an overlay, this will point to the PRICE_PLOT.- See Also:
-
-
Constructor Details
-
Plot
public Plot()
-
-
Method Details
-
getName
-
setName
Sets the name of this plot (human readable).- Parameters:
name- name of this plot
-
getLabelPrefix
-
setLabelPrefix
Sets the label prefix for this plot.- Parameters:
label- label prefix
-
setLabelSettings
Use this method to identify which settings should be part of the plot label (and to identify the study).- Parameters:
vals- label setting values
-
getLabelSettings
-
setIDSettings
Use this method to identify which settings should be part of the plot identifier. By default, the label settings will be used. Use this to override the label settings.- Parameters:
vals- ID setting values
-
getIDSettings
-
getTabName
-
setTabName
Sets the name to display in the tab for this plot.- Parameters:
name- tab name
-
isShowLabel
public boolean isShowLabel()Determins if the labe should be shown for this plot.- Returns:
- true if the label should be shown for this plot.
-
setShowLabel
public void setShowLabel(boolean b) Sets the flag for showing the label for this plot.- Parameters:
b- true if the label should be shown
-
setRangeKeys
Use this method to identify the numeric values generated by this study that are to affect the vertical range of the plot (when auto scale is turned on).- Parameters:
keys- range keys
-
getRangeKeys
-
declarePath
Declare a path associated with the given value key. 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- key of the series of values for the pathpathSettingsKey- settings key of the path
-
clearPaths
public void clearPaths()Clears the declared paths. -
declarePriceBar
Declare a price bar associated with the given value key. Settings for the path are resolved using the priceBarKey. At runtime price bars will be drawn (if enabled) using the values defined by the valueKey.- Parameters:
valueKey- key of the series of values for the price barpriceBarKey- settings key of the price bar
-
clearPriceBars
public void clearPriceBars()Clears the declared price bars. -
declareIndicator
-
clearIndicators
public void clearIndicators()Clears the declared indicators. -
declareBars
Declare a bar sequence associated with the given value key. 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- key of the series of values for the barssettingsKey- settings key for the bars
-
declareBars
Declare bar sequence using the default settings for drawing bars.- Parameters:
valueKey- key of the series of values for the bars
-
clearBars
public void clearBars()Clears the declared bars. -
declareGuide
Declare a guide to be displayed on this plot.- Parameters:
settingsKey- setting key for the guide
-
clearGuides
public void clearGuides()Clears the declared guides. -
addHorizontalLine
Adds a horizontal line to the graph 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 graph (in pixels).- Returns:
- top inset pixels
-
setTopInsetPixels
public void setTopInsetPixels(int pixels) Sets the top inset for the graph (in pixels).- Parameters:
pixels- pixels for the top inset
-
getBottomInsetPixels
public int getBottomInsetPixels()Gets the bottom inset for the graph (in pixels).- Returns:
- bottom inset pixels
-
setBottomInsetPixels
public void setBottomInsetPixels(int pixels) Sets the bottom inset for the graph (in pixels).- Parameters:
pixels- pixels for the bottom inset
-
getFixedBottomValue
Gets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).- Returns:
- fixed bottom value
-
setFixedBottomValue
Sets the 'fixed' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).- Parameters:
value- fixed bottom value
-
getFixedTopValue
Gets the 'fixed' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).- Returns:
- fixed top value
-
setFixedTopValue
Sets the 'fixed' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).- Parameters:
value- fixed top value
-
getMaxBottomValue
Gets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).- Returns:
- maximum bottom value
-
setMaxBottomValue
Sets the 'maximum' bottom value (null if not defined). This value is used to determine the range of the graph (bottom of the vertical axis).- Parameters:
value- maximum bottom value
-
getMinTopValue
Gets the 'minimum' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).- Returns:
- minimum top value
-
setMinTopValue
Sets the 'minimum' top value (null if not defined). This value is used to determine the range of the graph (top of the vertical axis).- Parameters:
value- minimum top value
-
getMinTick
Gets the minimum tick value for the vertical axis (if this is not an overlay). Null is return if this value should be calculated automatically- Returns:
- minimum tick
-
setMinTick
Sets the minimum tick for the vertical axis (if this is not an overlay). Set to null (default) to automatically detect the min value.- Parameters:
minTick- minimum tick
-
getHorizontalLines
-
getPaths
-
getPriceBars
-
getIndicators
-
getBars
-
getGuides
-
isFormatMK
public boolean isFormatMK()Determines if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).- Returns:
- true if this study allows formatting values using shortened versions (ie: 10000 is 10K, 10000000 is 10M).
-
setFormatMK
public void setFormatMK(boolean b) Sets the flag for formatting shortened version of values (ie: 10000 is 10K, 10000000 is 10M).- Parameters:
b- true if MK formatting should be used
-
getInstrument
Gets the instrument for this plot, null if the plot is not plotting instrument prices.- Returns:
- the instrument for this plot.
-
setInstrument
Sets the instrument for this plot, null if the plot is not plotting instrument prices.- Parameters:
instrument- the instrument for this plot, null if not plotting prices.
-
isAllowInsetModification
public boolean isAllowInsetModification()Determines if the user is allowed to modify insets for this study (non-overlays only, true by default).- Returns:
- true if the user is allowed to modify insets for this study (non-overlays only, true by default).
-
setAllowInsetModification
public void setAllowInsetModification(boolean b) Sets the flag for determining if the user can modify the insets for this study (non-overlays only).- Parameters:
b- true if the use can modify insets.
-
isAllowDisable
public boolean isAllowDisable()Determines if the user is allowed to disable (hide) this plot.- Returns:
- true if the user is allowed to disable (hide) this plot.
-
setAllowDisable
public void setAllowDisable(boolean b) Sets the the ability for the user to disable (hide) this plot.- Parameters:
b- true if the user is allowed to disable this plot.
-
isEnabled
public boolean isEnabled()Determines if this plot is enabled.- Returns:
- true if this plot is enabled (displayed to the user).
-
setEnabled
public void setEnabled(boolean b) Sets the flag for enabling this plot. If false, this plot will not be displayed.- Parameters:
b- true if this plot is enabled
-
clone
-