API Reference
Namespaces
Modules
Classes
Events
Global
Externals

Class: SignalIQ

CIQ. SignalIQ (config)


new SignalIQ(config)

Creates a SignalIQ helper object that is used to manage the signalling studies.

Parameters:
Name Type Description
config object

Parameters for setting up the SignalIQ plug-in.

Properties
Name Type Argument Description
stx CIQ.ChartEngine

A reference to the chart to which the plug-in is added.

panelHeight number

Default height screen study panel will occupy when revealed (panel study only).

displayCondition boolean <optional>

Set to true to display the condition that triggered a signal in the expanded tooltip.

emojiPicker object <optional>

Implementation of an emojiPicker. This is used by the signaliqDialog or other dialog implementation to allow emojis to be displayed on the chart as signal markers. The default picker is lightweight and you are free to swap in your own. If you do so, you must implement two functions: open() and clean(). The emojiPicker will resolve to undefined unless it is imported and passed as a resource to getDefaultConfig(). See example below.

Properties
Name Type Argument Description
open function <optional>

Creates the picker and adds its markup to the DOM if it doesn't already exist, and opens it. It may use the list of short names provided in config.emojiPicker.emojis to generate the choices within the picker. Takes an object as an argument, with three properties: - stx: The Chart engine instance - targetElement: Either a selector or the actual HTMLElement which is a reference point to position the picker - handler: a callback function which processes the chosen emoji. The function takes a parameter emoji which is the emoji character chosen.

clean function <optional>

Removes any artifacts remaining in memory from creation of picker. Takes no arguments.

emojis Array.<string> <optional>

Array of emoji short names to be used in an emoji dialog implemented by config.emojiPicker. Short names are expressed without any surrounding colons. To indicate skin tones, the default implementation of emojiPicker expects a pipe to separate the short names; for example, "point_up|skin-tone-4".

disallowedStudies Array.<string> <optional>

A list of studies to not appear for signaling.

Since:
  • 8.9.0 added config.disallowedStudies

Example
// Importing and using an emoji picker
 import getDefaultConfig from "./js/defaultConfiguration.js";
 import EmojiPopover from "./js/thirdparty/emoji-popover.es.js";
	const config = getDefaultConfig({
		emojiPicker: EmojiPopover,
		...
	});

Namespaces

Emojimarker
Marker
Paintbar

Members


allowedStudies :boolean

Holds a list of allowed study types for signaling. Leave blank to include all studies or set config.disallowedStudies to an empty array.

Type:
  • boolean
Since:
  • 8.6.0


isMultiChart :boolean

Indicates whether this chart is participating in a multichart container.

Type:
  • boolean
Since:
  • 10.4.0


<static> notificationTypes :Array.<string>

Holds loaded notification types. Any subclass that visualizes alerts should add its notification type to this array when the subclass is loaded.

Type:
  • Array.<string>
Since:
  • 8.6.0


<static> stylesheets :Array.<CIQ.SignalIQ~Stylesheet>

Holds loaded stylesheets for loading when CIQ.SignalIQ is constructed.

Type:
Since:
  • 8.6.0

Methods


addSignalToActiveChart(signalId)

Adds one signal study from the master catalog to the active chart.

Parameters:
Name Type Description
signalId string

The signalData.id of the signal to add.

Since:
  • 10.4.0

Returns:

The existing or newly added study descriptor, or null if not added.

Type
CIQ.Studies.StudyDescriptor | null

addStudyAsSignal(type [, signalData])

Creates a default study and converts it into an signal study. To add a customized study, first create the study, then use CIQ.SignalIQ#convertStudyToSignal.

Parameters:
Name Type Argument Description
type string

The name of the study (object key on the CIQ.Studies.studyLibrary)

signalData CIQ.SignalIQ~SignalData <optional>

Data and configuration for the signals.

Since:
  • 8.6.0

Returns:

A study descriptor which can be used to remove or modify the study.

Type
CIQ.Studies.StudyDescriptor | undefined
Example
stxx.signalIQ.addStudyAsSignal("Aroon", {
	name: "Aroon Extreme",
	conditions: [
		["Aroon Up ‌Aroon‌ (14)", ">", 90],
		["Aroon Down ‌Aroon‌ (14)", "<=", 5]
	],
	joiner: "&"
});

configureStudyBrowserIntegration( [params] [, topNode])

This method is intentionally idempotent and safe to call from either SignalIQ or Study Browser lifecycle events.

Parameters:
Name Type Argument Description
params object <optional>

Optional invocation metadata.

Properties
Name Type Argument Description
menuConfig string <optional>

Explicit studies menu config override ("studybrowser" or "studies") used during breakpoint-driven reconfigure.

topNode HTMLElement <optional>

Optional top node for the study browser integration.

Since:
  • 10.4.0


convertStudyToSignal(sd, signalData [, replace])

Converts a study descriptor into an signal study. Use this to attach signalData object to a study descriptor. It will overwrite any previous signalData. This is useful for setting new signalData as well as updating conditions. Any existing signals from this study will be removed.

Note: When calling this function it is assumed that the study defined in the study descriptor exists on the chart.

Parameters:
Name Type Argument Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

signalData CIQ.SignalIQ~SignalData

Data and configuration for the signals.

replace boolean <optional>

True if replacing existing signal data.

Since:
  • 10.4.0 In multichart, newly created signal studies are synced to the master chart by signalData.id.

Returns:

True if signalData was added or modified successfully

Type
boolean

flagSignals(sd)

Finds where signals take place on the study series. Creates objects of type CIQ.SignalIQ~NotificationData corresponding to matches in the signal conditions and stores them in the results array of study's signalData. This function is called from CIQ.ChartEngine#createDataSet.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

Since:
  • 8.6.0


flagSignals(sd)

Toggles the display state of the study.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

Since:
  • 8.7.0


getMasterChart()

Gets the master chart engine when this chart is part of a multichart container.

Since:
  • 10.4.0

Returns:

The master chart engine, or null when not in multichart.

Type
CIQ.ChartEngine | null

getMasterSignals( [params])

Returns signal studies from the master signalMaster catalog, keyed by the requested index type.

Parameters:
Name Type Argument Description
params object <optional>

Optional parameters.

Properties
Name Type Argument Default Description
indexType string <optional>
"studyname"

Key type for returned object. Valid values are "studyname", "signalname", and "signalid".

Since:
  • 10.4.0

Returns:

Map of signal studies keyed by the selected index type.

Type
object

getPortableSignalConfig(studyConfig [, placeholderString])

Clones and normalizes a serialized signal config for safe cross-chart reuse.

Parameters:
Name Type Argument Default Description
studyConfig object

The serialized study config.

placeholderString string <optional>
"StudyID"

Placeholder used for study-id references in conditions.

Since:
  • 10.4.0

Returns:

A cloned study config.

Type
object

getSignalMaster()

Ensures the multichart master layout has a signalMaster catalog object.

Since:
  • 10.4.0

Returns:

The signalMaster catalog, or null when not in multichart.

Type
object | null

getSignalStudyListing()

Returns a menu-friendly list of signal studies from the master chart when in multichart, or from the current chart in solo mode.

Since:
  • 10.4.0

Returns:

Array of objects in the form:

  • id: signalData.id
  • name: signalData.name
  • isActive: True if the active chart contains a signal study with matching signalData.id
  • study: Serialized study config from layout.signalMaster in multichart, or source study descriptor in solo mode
Type
Array.<object>

hide(sd)

Hides the study from view.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

Since:
  • 8.6.0


rebuildSignalMasterFromCharts()

Rebuilds the master signalMaster catalog from all visible child charts.

Since:
  • 10.4.0

Returns:

Rebuilt signalMaster catalog, or null when not in multichart.

Type
object | null

refresh()

Convenience function to manually refresh the signals from the study.

Since:
  • 8.6.0


removeSignalFromCharts(signalStudyOrId [, onlyActiveChart])

Removes a signal study from all child charts (excluding master) by signal id.

Parameters:
Name Type Argument Default Description
signalStudyOrId CIQ.Studies.StudyDescriptor | object | string

A study descriptor, serialized study config, or direct signalData.id string.

onlyActiveChart boolean <optional>
false

When true, remove only from the active chart. If no matching study remains on any other chart after removal, remove the master catalog entry.

Since:
  • 10.4.0


removeSignalMasterEntry(signalId)

Removes a signal study entry from the master signalMaster catalog.

Parameters:
Name Type Description
signalId string

The unique signalData.id value.

Since:
  • 10.4.0


removeSignals(sd)

Removes all signals associated with study. Called automatically by CIQ.ChartEngine#cleanupRemovedStudy.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

Since:
  • 8.6.0


setSignalFromMaster(signalId, targetChart [, options])

Sets a signal study on a target chart from the master signal catalog by signalData.id.

Parameters:
Name Type Argument Description
signalId string

The unique signalData.id value.

targetChart CIQ.ChartEngine

The chart receiving the signal study.

options object <optional>

Optional behavior controls.

Properties
Name Type Argument Default Description
requireExisting boolean <optional>
false

Require a pre-existing signal on the target chart.

returnExisting boolean <optional>
false

Return existing signal without replacing it.

Since:
  • 10.4.0

Returns:

Existing or newly imported signal study, or null.

Type
CIQ.Studies.StudyDescriptor | null

show(sd [, height])

Reveals the study on the chart. The study will also show the signals along its plot line.

Parameters:
Name Type Argument Default Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

height number <optional>
0

Optional height of panel in pixels.

Since:
  • 8.6.0


studies( [params])

Convenience function for returning only studies which produce signals.

Parameters:
Name Type Argument Description
params object <optional>

Optional parameters.

Properties
Name Type Argument Default Description
indexType string <optional>
"studyname"

Key type for returned object. Valid values are "studyname", "signalname", and "signalid".

Since:
  • 10.4.0 Added optional params.indexType to control return-object indexing.

Returns:

Subset of all studies.

Type
Array.<CIQ.Studies.StudyDescriptor>

syncSignalToCharts(sd)

Synchronizes a signal study edit from the active chart to all other non-master charts that already contain the same signalData.id, and updates the master layout.signalMaster catalog entry.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The source study descriptor.

Since:
  • 10.4.0


syncSignalToMaster(sd)

Exports a signal study from the active chart and updates the master layout.signalMaster catalog entry by signalData.id.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The source study descriptor.

Since:
  • 10.4.0


upsertSignalMasterEntry(studyConfig)

Adds or replaces a signal study entry in the master signalMaster catalog.

Parameters:
Name Type Description
studyConfig object

Serialized study config containing signalData.id.

Since:
  • 10.4.0

Returns:

The stored study config entry, or null if invalid.

Type
object | null

verifySignalData( [signalData] [, forceReplace])

Cursory check if the signal data is properly constructed. A name and conditions array must be provided. The name cannot already be in use.

The following codes and messages are currently defined:

Code Message
0 "ok"
1 "no data"
2 "no name"
3 "no conditions"
4 "invalid conditions"
5 "already exists"
Parameters:
Name Type Argument Description
signalData CIQ.SignalIQ~SignalData <optional>

Data and configuration for the signals.

forceReplace boolean <optional>

True if replacing existing signal data should occur.

Since:
  • 8.6.0

Returns:

Error code and message. If no error, code will be 0.

Type
CIQ.SignalIQ~VerificationInfo

Type Definitions


NotificationData

Used directly by CIQ.SignalIQ#flagSignals when creating alerts.

Type:
  • object
Properties:
Name Type Argument Description
signalData CIQ.SignalIQ~SignalData

Study descriptor's signalData object.

color string <optional>

Color of signal, if applicable.

conditions Array.<string> <optional>

Text strings containing conditions met by signal.

field string <optional>

Name of field where signal occurred.

isPlotSpecific boolean <optional>

True if signal is to be tied to the plot which triggered it.

sd CIQ.Studies.StudyDescriptor

Study descriptor.

stx CIQ.ChartEngine

Instance of chart engine.

tick number

Index to data set where signal occurred.


SignalData

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

Unique identifier for the signal study.

notificationType string

Type of notification for the signal. e.g. marker, emojimarker, paintbar`.

name string

Name of Signal. Signal will be saved with this name and this name will appear in any study legend and in the expanded signal's title.

conditions Array.<Array.<string>>

Array of conditions; each condition is itself an array of [lhs, operator, rhs, color, markerOptions]
- lhs is a field in the study's outputMap
- rhs can be either a numeric value or a field in the study's outputMap
- operator can be "<", "<=", "=", ">", ">=", "<>", ">p" (greater than previous), "<p" (less than previous), "=p" (same as previous), "x" (crosses another plot/value in either direction), "x+" (crosses another plot/value upwards", "x-" (crosses another plot/value downwards," "t+" (turns upwards", "t-" (turns downwards"
- color is the color of the signal. If not provided, lhs's color will be used
- markerOptions Optional settings for main series marker. When multiple conditions match, markerOptions from the first matching condition are applied.
- markerOptions.shape Shape of the signal marker on the chart. The shape of the marker on the study will always be "circle". If omitted, "text" assumed.
- markerOptions.size Size of the signal marker on the chart. Possible values are S/M/L. The size of the marker on the study will always be S. If omitted, "S" assumed.
- markerOptions.label Optional string to display in the marker.
- markerOptions.position Where to display the signal as a marker in relation to the main plot. See CIQ.Marker for options. If omitted, "above_candle" assumed.

joiner string <optional>

& or | to join conditions. If omitted, "|" assumed.

results Array.<CIQ.SignalIQ~NotificationData>

Signals indicating where conditions were met.

description string <optional>

Description of signal.

reveal boolean <optional>

Whether to display the study. If omitted, "false" assumed.

position string <optional>

Where to display the signal as a marker in relation to the main plot. See CIQ.Marker for options. If omitted, "above_candle" assumed.

shape string <optional>

Shape of the signal marker on the chart. The shape of the marker on the study will always be "circle". If omitted, "text" assumed.

size string <optional>

Size of the signal marker on the chart. Possible values are S/M/L. The size of the marker on the study will always be S. If omitted, "S" assumed.

panelHeight number <optional>

Number of pixels in a panel study when revealed. Defaults to plugin config's panelHeight.

label string <optional>

Optional string to display in the marker.

destination string <optional>

Optional delivery point of alert.


Stylesheet

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

URL of stylesheet

callback function <optional>

callback after successful load


VerificationInfo

Type:
  • object
Properties:
Name Type Description
code number

Verification error code, or 0 if no error

message string

Message accompanying code