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
-
<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
-
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.
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 sdCIQ.Studies.StudyDescriptor The study descriptor.
signalDataCIQ.SignalIQ~SignalData Data and configuration for the signals.
replaceboolean <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
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
-
hide(sd)
-
Hides the study from view.
Parameters:
Name Type Description sdCIQ.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 sdCIQ.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 sdCIQ.Studies.StudyDescriptor The study descriptor.
heightnumber <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 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 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
