new TechnicalInsights(stx, token, lang, mapToTCSymbology, tcApiPath)
Controller class to assist in the creation and processing of TechnicalInsights API requests.
Parameters:
| Name | Type | Description |
|---|---|---|
stx |
CIQ.ChartEngine | A chart instance to modify |
token |
string | A valid TechnicalInsights authentication token |
lang |
string | Language identifier, eg "en". Must match an option in lexicon.json |
mapToTCSymbology |
function | (Optional) This is the user-defined method that is called to map the client's symbology to Trading Central symbology. The method takes the ticker and exchange as inputs and returns the Trading Central symbology (ticker and exchange). |
tcApiPath |
string | API URL |
Members
-
activeEvents :object
-
Events to show
Type:
- object
-
auth :string
-
Authoriztion token
Type:
- string
-
bollingerBands :null|CIQ.Studies.StudyDescriptor
-
Bollinger bands study descriptor
Type:
- null | CIQ.Studies.StudyDescriptor
-
colors :object
-
Colors used for displaying the lines and labels of the analysis
Type:
- object
-
drawnEvents :Map.<string, undefined>
-
Track if event has been clicked/drawn so we can highlight event dot
Type:
- Map.<string, undefined>
-
drawnLabels :Map.<string, undefined>
-
Track event hover and support/resistance hover labels
Type:
- Map.<string, undefined>
-
drawnStudies :Map.<string, CIQ.Studies.StudyDescriptor>
-
Track studies
Type:
- Map.<string, CIQ.Studies.StudyDescriptor>
-
eventDotsInjection :object|null
-
Draw injections being used for drawing the dots
Type:
- object | null
-
eventMarkupDrawInjections :Map.<string, object>
-
List of the draw injections being used for event drawing
Type:
- Map.<string, object>
-
eventMarkupInjections :Map.<string, object>
-
List of the draw injections being used for event markup
Type:
- Map.<string, object>
-
iid :null
-
Initially set to null, id
Type:
- null
-
interval :string
-
Chart interval
Type:
- string
-
lang :string
-
Language code
Type:
- string
-
mouseDownInjections :Map.<string, object>
-
Mouse related injections
Type:
- Map.<string, object>
-
mouseMoveInjections :Map.<string, object>
-
Mouse related injections
Type:
- Map.<string, object>
-
panel :CIQ.ChartEngine.Panel
-
Display lines and labels of the analysis on the primary chart
Type:
-
rsi :null|CIQ.Studies.StudyDescriptor
-
RSI study descriptor
Type:
- null | CIQ.Studies.StudyDescriptor
-
showEducation :boolean
-
Whether to show education information
Type:
- boolean
-
studyInstances :Map.<string, number>
-
Track the number of times a study has been invoked (can be multiple e.g. sma 50)
Type:
- Map.<string, number>
-
stx :CIQ.ChartEngine
-
Chart engine
Type:
Methods
-
addEventLabelMouseInjections(events)
-
Creates an injection on the mousemove method to create events based on cursor position over event labels.
Parameters:
Name Type Description eventsArray.<object> Array of events to be retrieved from the TechnicalInsights API
-
addListeners()
-
Adds symbol change and layout listeners to the chart, which will allow the plugin to respond and load new events as appropriate. This method should be called after initializing the plugin.
-
addSupportAndResistanceMouseInjections(params)
-
Adds support and resistance mouse injections
Parameters:
Name Type Description paramsobject Properties
Name Type Description intervalstring | number Support/Resistance interval
termstring Support/Resistance term
supportpricenumber Support price
resistancepricenumber Reisitance price
-
changeChartEngine(stx)
-
Update chart engine reference
Used for multi chart when switching to a differennc active chart
Parameters:
Name Type Description stxCIQ.ChartEngine Updated chart engine
-
doesCoordOverlapEvent(stx, controller, event, coords, allowedRange, eventsMaps)
-
Helper function to determine if certain coordinates overlap the an event's location
Parameters:
Name Type Description stxobject Instance of ChartIQ Engine
controllerobject A reference to the instance of the TechnicalInsights Plugin Controller
eventobject The event to check
coordsCIQ.TechnicalInsights~Coordinate The coordinate to check for overlap on event
allowedRangenumber The allowed overlappable range away from the edge of the symbol for being considered overlapping
eventsMapsobject Maps for bearish and bullish events
Returns:
true if coordinate overlaps the event, false if skipped or does not overlap
- Type
- boolean
-
drawActiveEventLabels(events)
-
Creates an injection on the draw loop that renders TechnicalInsights events to the chart.
Parameters:
Name Type Description eventsArray.<object> Array of events to be retrieved from the TechnicalInsights API
-
drawClassicEventMarkup(event)
-
Create injections to display Lines and Regions of the TechnicalInsights Event.
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
drawEventMarkup(event)
-
Calls the appropriate draw method based on the event passed in.
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
drawIndicatorEventMarkup(event)
-
Create chart changes and markup for Indicators (Moving Average)
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
drawOscillatorEventMarkup(event)
-
Create chart changes and markup for Oscillators
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
drawShortTermEventMarkup(event)
-
Create chart changes and markup for Short-term events (Candlestick patterns)
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
drawSupportAndResistance(support, resistance, term, interval)
-
Creates an injection on the draw loop that renders support and resistance lines to the chart.
Parameters:
Name Type Description supportnumber The price value for the support line
resistancenumber The price value for the resistance line
termstring The number of ticks in the support and resistance term
intervalstring The chart interval
-
eventClick(params)
-
Handles when a user clicks on an event
Parameters:
Name Type Description paramsobject Properties
Name Type Description eventobjobject Event
-
eventHoverBegin(params)
-
Executes the relevant logic when the user hovers over an event
Parameters:
Name Type Description paramsobject Properties
Name Type Description eventLabelstring Label
eventidstring ID
eventTypeCodenumber Type Code
dateDate Date
pricenumber Price
-
eventHoverEnd()
-
Executes the relevant logic for when the user stops hovering over an event
-
eventSingleTouch(params)
-
Handles when a user on a touch device touches an event
Parameters:
Name Type Description paramsCIQ.TechnicalInsights~EventTriggerParams -
eventSingleTouchEnd()
-
Handles when a user on a touch device touches anywhere but an event on the screen. Ends all hover events if any.
-
eventTappedEventListener(controller, events, stx, onTappedCallback, onNoEventTappedCallback)
-
Listener that executes callback when event is tapped by either a mouse or finger
Parameters:
Name Type Description controllerobject A reference to the instance of the TechnicalInsights Plugin Controller
eventsArray.<object> array of events obtained from the API
stxobject Instance of ChartIQ Engine
onTappedCallbackfunction Callback for when event is tapped. Passes a parameter containing the y coordinate and Event object
onNoEventTappedCallbackfunction Callback for when no event was tapped. No parameters are passed
-
getActiveEvents()
-
Method to get the TechnicalInsights active events, and draw the event 'dots' on the chart. Call this method when instantiating or enabling the plugin.
-
getCurrentTerm()
-
Determine the current term from the layout.
Returns:
the name of the term or undefined
- Type
- string
-
getEventLabel(eventObj)
-
Gets the Event Label for a given event
Parameters:
Name Type Description eventObjobject The event object of which to get a label
Returns:
Event label as string
-
getEvents(params, cb)
-
Makes a request to the Trading Central API for TechnicalInsights events.
Parameters:
Name Type Description paramsobject Properties
Name Type Description intervalstring The data interval, ie "day" or "week"
symbolstring The chart symbol
exchangestring The exchange for the symbol
cbfunction The callback function to call after request is complete
-
getMarkerPriceFromYCoord(stx, eventObj, yCoord)
-
Gets the Price of an event marker derivated from a y coordinate
Parameters:
Name Type Description stxobject Instance of ChartIQ Engine
eventObjobject yCoordnumber Returns:
the price or undefined if trade type is not long, short or undefined
-
getPermissions()
-
Method to get product permissions from the permissions api
-
getSupportAndResistance(params, cb)
-
Gets the data for support and resistance lines
Parameters:
Name Type Description paramsobject Properties
Name Type Description intervalstring | number The chart interval
periodicitynumber The chart periodicity
symbolstring The chart symbol
exchangestring The exchange (symbol.exchDisp)
cbfunction Callback function
-
hideIndicators()
-
Remove previously shown studies used to aid in the analysis.
-
isElliottWaveAllowed()
-
Method to check whether elliott waves is enabled on this client calls callback with boolean. True if elliott waves is enabled, false otherwise
-
priceLabel(price, colorName)
-
Draw a label on the chart panel YAxis for the given price.
Parameters:
Name Type Description pricenumber the value to display
colorNamestring name in
this.colorsto use when drawing the label -
priceLine(price, colorName [, emphasize])
-
Draw a line on the chart panel for the given price.
Parameters:
Name Type Argument Default Description pricenumber the value to display
colorNamestring name in
this.colorsto use when drawing the lineemphasizeboolean <optional>
false if the price line should be thicker than normal
-
removeInjections()
-
Calls CIQ.ChartEngine.prototype.removeInjection for each display function
-
removeListeners()
-
Removes symbol changes and layout listeners from the chart. This method should be called after disabling the plugin.
-
removeMarkupForEvent(event)
-
Calls CIQ.ChartEngine.prototype.removeInjection for a SPECIFIC injection (event markup)
Parameters:
Name Type Description eventobject Object containing information about a specific event
-
setUsageTracking()
-
Call log API to save which clients are using our plugin and which version of Chart IQ we are integrated into
-
showIndicators()
-
Show studies that aid in the analysis.
-
supportAndResistanceHoverBegin(params)
-
Executes the relevant logic when the user hovers over a support or resistance line
Parameters:
Name Type Description paramsobject Properties
Name Type Description srtypestring "support" or "resistance"
markerpricenumber The price for where to intersect the price on the y-axis
termstring The number of bars used
pricenumber Price
-
supportAndResistanceHoverEnd(params)
-
Executes the relevant logic when the user stops hovering over a support or resistance line
Parameters:
Name Type Description paramsobject Properties
Name Type Description srtypestring "support" or "resistance"
Type Definitions
-
Coordinate
-
x and y values
Type:
- object
Properties:
Name Type Description xnumber The x value of the coordinate
ynumber The y value of the coordinate
-
EventTriggerParams
-
Parameters passed to touch handler.
Properties:
Name Type Description eventobjobject yCoordnumber
