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
|
- 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
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:
- Array.<CIQ.SignalIQ~Stylesheet>
- Since:
-
8.6.0
Methods
-
addSignalToActiveChart(signalId)
-
Adds one signal study from the master catalog to the active chart.
Parameters:
Name Type Description signalIdstring The
signalData.idof 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 typestring The name of the study (object key on the CIQ.Studies.studyLibrary)
signalDataCIQ.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 paramsobject <optional>
Optional invocation metadata.
Properties
Name Type Argument Description menuConfigstring <optional>
Explicit studies menu config override ("studybrowser" or "studies") used during breakpoint-driven reconfigure.
topNodeHTMLElement <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 sdCIQ.Studies.StudyDescriptor The study descriptor.
signalDataCIQ.SignalIQ~SignalData Data and configuration for the signals.
replaceboolean <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
resultsarray of study'ssignalData. This function is called from CIQ.ChartEngine#createDataSet.Parameters:
Name Type Description sdCIQ.Studies.StudyDescriptor The study descriptor.
- Since:
-
8.6.0
-
flagSignals(sd)
-
Toggles the display state of the study.
Parameters:
Name Type Description sdCIQ.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
signalMastercatalog, keyed by the requested index type.Parameters:
Name Type Argument Description paramsobject <optional>
Optional parameters.
Properties
Name Type Argument Default Description indexTypestring <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 studyConfigobject The serialized study config.
placeholderStringstring <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
signalMastercatalog object.- Since:
-
10.4.0
Returns:
The
signalMastercatalog, 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.idname:signalData.nameisActive: True if the active chart contains a signal study with matchingsignalData.idstudy: Serialized study config fromlayout.signalMasterin multichart, or source study descriptor in solo mode
- Type
- Array.<object>
-
hide(sd)
-
Hides the study from view.
Parameters:
Name Type Description sdCIQ.Studies.StudyDescriptor The study descriptor.
- Since:
-
8.6.0
-
rebuildSignalMasterFromCharts()
-
Rebuilds the master
signalMastercatalog from all visible child charts.- Since:
-
10.4.0
Returns:
Rebuilt
signalMastercatalog, 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 signalStudyOrIdCIQ.Studies.StudyDescriptor | object | string A study descriptor, serialized study config, or direct
signalData.idstring.onlyActiveChartboolean <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
signalMastercatalog.Parameters:
Name Type Description signalIdstring The unique
signalData.idvalue.- Since:
-
10.4.0
-
removeSignals(sd)
-
Removes all signals associated with study. Called automatically by CIQ.ChartEngine#cleanupRemovedStudy.
Parameters:
Name Type Description sdCIQ.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 signalIdstring The unique
signalData.idvalue.targetChartCIQ.ChartEngine The chart receiving the signal study.
optionsobject <optional>
Optional behavior controls.
Properties
Name Type Argument Default Description requireExistingboolean <optional>
false Require a pre-existing signal on the target chart.
returnExistingboolean <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 sdCIQ.Studies.StudyDescriptor The study descriptor.
heightnumber <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 paramsobject <optional>
Optional parameters.
Properties
Name Type Argument Default Description indexTypestring <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 masterlayout.signalMastercatalog entry.Parameters:
Name Type Description sdCIQ.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.signalMastercatalog entry bysignalData.id.Parameters:
Name Type Description sdCIQ.Studies.StudyDescriptor The source study descriptor.
- Since:
-
10.4.0
-
upsertSignalMasterEntry(studyConfig)
-
Adds or replaces a signal study entry in the master
signalMastercatalog.Parameters:
Name Type Description studyConfigobject 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 signalDataCIQ.SignalIQ~SignalData <optional>
Data and configuration for the signals.
forceReplaceboolean <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 Definitions
-
NotificationData
-
Used directly by CIQ.SignalIQ#flagSignals when creating alerts.
Type:
- object
Properties:
Name Type Argument Description signalDataCIQ.SignalIQ~SignalData Study descriptor's signalData object.
colorstring <optional>
Color of signal, if applicable.
conditionsArray.<string> <optional>
Text strings containing conditions met by signal.
fieldstring <optional>
Name of field where signal occurred.
isPlotSpecificboolean <optional>
True if signal is to be tied to the plot which triggered it.
sdCIQ.Studies.StudyDescriptor Study descriptor.
stxCIQ.ChartEngine Instance of chart engine.
ticknumber Index to data set where signal occurred.
-
SignalData
-
Used directly by CIQ.SignalIQ#addStudyAsSignal and CIQ.SignalIQ#convertStudyToSignal, or indirectly by CIQ.SignalIQ#flagSignals.
Type:
- object
Properties:
Name Type Argument Description idstring <optional>
Unique identifier for the signal study.
notificationTypestring Type of notification for the signal. e.g.
marker,emojimarker, paintbar`.namestring 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.
conditionsArray.<Array.<string>> Array of conditions; each condition is itself an array of [lhs, operator, rhs, color, markerOptions]
-lhsis a field in the study's outputMap
-rhscan be either a numeric value or a field in the study's outputMap
-operatorcan 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"
-coloris the color of the signal. If not provided, lhs's color will be used
-markerOptionsOptional settings for main series marker. When multiple conditions match, markerOptions from the first matching condition are applied.
-markerOptions.shapeShape of the signal marker on the chart. The shape of the marker on the study will always be "circle". If omitted, "text" assumed.
-markerOptions.sizeSize 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.labelOptional string to display in the marker.
-markerOptions.positionWhere to display the signal as a marker in relation to the main plot. See CIQ.Marker for options. If omitted, "above_candle" assumed.joinerstring <optional>
& or | to join conditions. If omitted, "|" assumed.
resultsArray.<CIQ.SignalIQ~NotificationData> Signals indicating where conditions were met.
descriptionstring <optional>
Description of signal.
revealboolean <optional>
Whether to display the study. If omitted, "false" assumed.
positionstring <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.
shapestring <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.
sizestring <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.
panelHeightnumber <optional>
Number of pixels in a panel study when revealed. Defaults to plugin config's panelHeight.
labelstring <optional>
Optional string to display in the marker.
destinationstring <optional>
Optional delivery point of alert.
-
Stylesheet
-
Used by CIQ.SignalIQ.stylesheets.
Type:
- object
Properties:
Name Type Argument Description urlstring URL of stylesheet
callbackfunction <optional>
callback after successful load
-
VerificationInfo
-
Returned by CIQ.SignalIQ#verifySignalData.
Type:
- object
Properties:
Name Type Description codenumber Verification error code, or 0 if no error
messagestring Message accompanying code
