API Reference
Namespaces
Classes
Events
Global
Externals

Class: SignalIQ

CIQ. SignalIQ


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 :Array.<string>

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

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


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


stylesheets :Array.<CIQ.SignalIQ~Stylesheet>

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

Type:
Since:
  • 8.6.0

Methods


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
Example
stxx.signalIQ.addStudyAsSignal("Aroon", {
	name: "Aroon Extreme",
	conditions: [
		["Aroon Up ‌Aroon‌ (14)", ">", 90],
		["Aroon Down ‌Aroon‌ (14)", "<=", 5],
	],
	joiner: "&",
});

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:
  • 8.6.0

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


hide(sd)

Hides the study from view.

Parameters:
Name Type Description
sd CIQ.Studies.StudyDescriptor

The study descriptor.

Since:
  • 8.6.0


refresh()

Convenience function to manually refresh the signals from the study.

Since:
  • 8.6.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


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()

Convenience function for returning only studies which produce signals.

Since:
  • 8.6.0

Returns:

Subset of all studies.

Type
Array.<CIQ.Studies.StudyDescriptor>

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
notificationType string

Type of notification for the signal. At this time the only defined value is marker.

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 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