Namespace: Studies

Studies

Studies namespace. Contains functions related to Studies.

Since:
  • 9.4.0

Type Definitions


StudyConfig

Configuration for studies available and their default settings. CompactChart comes with a handful of studies. It is possible to create additional studies, please contact us for assistance. The modules for built-in studies can be found in js/modules/studies. Only studies included in this configuration will be available to the chart.

Type:
Properties:
Name Type Argument Description
signalIQ SignalIQConfig <optional>

Presence of this property indicates SignalIQ availability.

types Record.<string, (StudyTypeConfig|undefined)> <optional>

Contains the configurations for each study.

Since:
  • 9.4.0


StudyDefinition

Basic definition of a study. The built-in studies all have their own default study definition settings, so it is only necessary to set one of these properties if you disagree with the default settings. A study definition has many fields, but only those more commonly used are documented here.

Type:
  • object
Properties:
Name Type Argument Description
display string <optional>

Name to display on legend if different than study name.

underlay boolean <optional>

Whether study is rendered under the main plot.

overlay boolean <optional>

Whether study is rendered over the main plot.

customLegend boolean <optional>

Indicates if custom legend is being used and study should not appear on built-in legend.

yaxis YAxisInit <optional>

Specifies dedicated y axis for the study. Not all properties of yaxis need to be set. The most common one is position.

inputs Record.<string, (number|string|boolean|Array.<string>)> <optional>

Override default inputs. You must specify all inputs even if overriding only one.

outputs Record.<string, StudyOutputColor> <optional>

Override default output colors and line treatments. You must specify all outputs even if overriding only one.

parameters StudyParameters <optional>

Override default parameters. You must specify all parameters even if overriding only one.

centerline number <optional>
<nullable>

Draws a horizontal line through the panel at the y axis level specified.

excludeFieldsFromID boolean | Array.<string> <optional>

Array of input fields to disregard when building the study id.

panelHeight number <optional>

Number of pixels to dedicate to this panel, otherwise it will be automatically determined.

displayGridLines boolean <optional>

Set to turn on grid lines for the study. By default grid lines are on for the main y axis only.

minMaxFields Array.<string> <optional>

If provided the minimum and maximum edges of the y axis will be computed from these fields only.

widthFactor number <optional>

If provided percentage of candlewidth space taken up by a histogram bar.

Since:
  • 9.4.0 Introduced
  • 10.1.0 Added widthFactor property.

StudyOutputColor

Definition of an output treatment.

Type:
  • object
Properties:
Name Type Argument Description
color string

Plot color.

pattern 'solid' | 'dashed' | 'dotted' <optional>

Plot line pattern.

width number <optional>

Plot line width in pixels.

Since:
  • 9.4.0


StudyParameters

Definition for study parameters.

Type:
  • object
Properties:
Name Type Argument Description
panelName string <optional>

Panel on which to display plot.

studyOverZonesEnabled boolean <optional>

Whether to use the study overbought/oversold zones functionality.

studyOverBoughtValue number <optional>

Overbought level.

studyOverBoughtColor string | StudyOutputColor <optional>

Color or treatment to use to decorate the overbought region.

studyOverSoldValue number <optional>

Oversold level.

studyOverSoldColor string | StudyOutputColor <optional>

Color or treatment to use to decorate the oversold region.

underlayEnabled boolean <optional>

Display plot as an underlay.

yaxisDisplayValue string <optional>

Specify position of y axis.

yaxisDisplayColor string <optional>

Specify color of y axis.

chartName string <optional>

Should be set to "chart".

display string <optional>

Set display name of study.

yAxis YAxisInit <optional>

Specify custom y axis.

flippedEnabled boolean <optional>

Whether plot is flipped, not in use.

opacity number <optional>

Plot opacity.

label boolean <optional>

Whether labels appear on the y axis.

plotType string <optional>

If speficied, overrides plot type used by study by default.

excludeYAxis boolean <optional>

Set to not draw y axis.

noSlopes boolean <optional>

Display a change in value without drawing a line between values.

extendToEnd boolean <optional>

Extend plot to present time if last data point is in the past.

Since:
  • 9.4.0


StudyPlotType

Allowed plot types for a study.

Type:
  • 'line' | 'mountain' | 'scatterplot' | 'step'
Since:
  • 9.4.0


StudyTypeConfig

Configuration for studies available and their default settings. CompactChart comes with a handful of studies. It is possible to create additional studies, please contact us for assistance. The modules for built-in studies can be found in js/modules/studies. Only studies included in this configuration will be available to the chart.

Type:
Properties:
Name Type Argument Description
modulePath string <optional>

Path to module file to dynamically load. Alternatively the module can be imported statically. It becomes available as a side effect.

signalData SignalDataConfig <optional>

SignalIQ signal setup for this study.

plotType StudyPlotType <optional>

Allows custom configuration of the study to render as a different plot type than the default.

label boolean <optional>

Specify if y axis label should appear for the study's current value(s).

baseColor string <optional>

Specify base color for a mountain plot.

Since:
  • 9.4.0