Class: Indicator

StockChartX. Indicator


new Indicator(config)

Represent abstract chart indicator.
Parameters:
Name Type Description
config Object The configuration object.
Properties
Name Type Argument Description
chart StockChartX.Chart <optional>
The parent chart.
parameters Object <optional>
The TA indicator parameters.
panelHeightRatio Number <optional>
The height ratio of the chart panel.
showValueMarkers Boolean <optional>
The flag that indicates whether value markers are visible.
showValuesInTitle Boolean <optional>
The flag that indicates whether values are visible in the title.

Members


chart :StockChartX.Chart

The parent chart
Type:

<readonly> chartPanel :StockChartX.ChartPanel

The parent chart panel.
Type:

isOverlay :boolean

True if it's an overlay indicator, false otherwise.
Type:
  • boolean

<readonly> panelHeightRatio :number

Gets panel height ratio. It is not used in case of overlay indicator.
Type:
  • number

parameters :object

The indicator parameters.
Type:
  • object

showValueMarkers :boolean

Gets/Sets flag that indicates whether value markers are visible on the value scale.
Type:
  • boolean

showValuesInTitle :boolean

Gets/Sets flag that indicates whether values are visible in the title.
Type:
  • boolean

Methods


<static> deserialize(state)

Deserializes indicator.
Parameters:
Name Type Description
state object The state.
Returns:
Type
StockChartX.Indicator

allIndicators()

Returns array of all available TA indicators.
Returns:
Type
Array.<number>

bands()

Returns array of band indicators.
Returns:
Type
Array.<number>

general()

Returns array of general indicators.
Returns:
Type
Array.<number>

getName()

Returns indicator name (e.g. 'Simple Moving Average').
Returns:
Type
string

getParameterValue(paramName)

Returns parameter value by name.
Parameters:
Name Type Description
paramName string The parameter name.
Returns:
Type
*

getPlotName(fieldName)

Returns plot's name. E.g. 'Top', 'Bottom', 'Median', ...
Parameters:
Name Type Description
fieldName string the TA field name.
Returns:
Type
string

getPlotName(fieldName)

Returns plot's name. E.g. 'Top', 'Bottom', 'Median', ...
Parameters:
Name Type Description
fieldName string the TA field name.
Returns:
Type
string

getShortName()

Returns short indicator name (e.g. 'SMA').
Returns:
Type
string

hasParameter(paramName)

Returns true if value is set for a given parameter name, false otherwise.
Parameters:
Name Type Description
paramName String The parameter name.
Returns:
Type
boolean

indices()

Returns array of index indicators.
Returns:
Type
Array.<number>

movingAverages()

Returns array of moving average indicators.
Returns:
Type
Array.<number>

oscillators()

Returns array of oscillator indicators.
Returns:
Type
Array.<number>

regressions()

Returns array of regression indicators.
Returns:
Type
Array.<number>

serialize()

Serializes indicator state.
Returns:
Type
object

setParameterValue(paramName, paramValue)

Sets parameter value.
Parameters:
Name Type Description
paramName string
paramValue * The

update()

Updates indicator.