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 events
Array.<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 params
object Properties
Name Type Description interval
string | number Support/Resistance interval
term
string Support/Resistance term
supportprice
number Support price
resistanceprice
number Reisitance price
-
changeChartEngine(stx)
-
Update chart engine reference
Used for multi chart when switching to a differennc active chart
Parameters:
Name Type Description stx
CIQ.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 stx
object Instance of ChartIQ Engine
controller
object A reference to the instance of the TechnicalInsights Plugin Controller
event
object The event to check
coords
CIQ.TechnicalInsights~Coordinate The coordinate to check for overlap on event
allowedRange
number The allowed overlappable range away from the edge of the symbol for being considered overlapping
eventsMaps
object 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 events
Array.<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 event
object Object containing information about a specific event
-
drawEventMarkup(event)
-
Calls the appropriate draw method based on the event passed in.
Parameters:
Name Type Description event
object Object containing information about a specific event
-
drawIndicatorEventMarkup(event)
-
Create chart changes and markup for Indicators (Moving Average)
Parameters:
Name Type Description event
object Object containing information about a specific event
-
drawOscillatorEventMarkup(event)
-
Create chart changes and markup for Oscillators
Parameters:
Name Type Description event
object Object containing information about a specific event
-
drawShortTermEventMarkup(event)
-
Create chart changes and markup for Short-term events (Candlestick patterns)
Parameters:
Name Type Description event
object 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 support
number The price value for the support line
resistance
number The price value for the resistance line
term
string The number of ticks in the support and resistance term
interval
string The chart interval
-
eventClick(params)
-
Handles when a user clicks on an event
Parameters:
Name Type Description params
object Properties
Name Type Description eventobj
object Event
-
eventHoverBegin(params)
-
Executes the relevant logic when the user hovers over an event
Parameters:
Name Type Description params
object Properties
Name Type Description eventLabel
string Label
eventid
string ID
eventTypeCode
number Type Code
date
Date Date
price
number 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 params
CIQ.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 controller
object A reference to the instance of the TechnicalInsights Plugin Controller
events
Array.<object> array of events obtained from the API
stx
object Instance of ChartIQ Engine
onTappedCallback
function Callback for when event is tapped. Passes a parameter containing the y coordinate and Event object
onNoEventTappedCallback
function 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 eventObj
object 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 params
object Properties
Name Type Description interval
string The data interval, ie "day" or "week"
symbol
string The chart symbol
exchange
string The exchange for the symbol
cb
function 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 stx
object Instance of ChartIQ Engine
eventObj
object yCoord
number 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 params
object Properties
Name Type Description interval
string | number The chart interval
periodicity
number The chart periodicity
symbol
string The chart symbol
exchange
string The exchange (symbol.exchDisp)
cb
function 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 price
number the value to display
colorName
string name in
this.colors
to 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 price
number the value to display
colorName
string name in
this.colors
to use when drawing the lineemphasize
boolean <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 event
object 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 params
object Properties
Name Type Description srtype
string "support" or "resistance"
markerprice
number The price for where to intersect the price on the y-axis
term
string The number of bars used
price
number Price
-
supportAndResistanceHoverEnd(params)
-
Executes the relevant logic when the user stops hovering over a support or resistance line
Parameters:
Name Type Description params
object Properties
Name Type Description srtype
string "support" or "resistance"
Type Definitions
-
Coordinate
-
x and y values
Type:
- object
Properties:
Name Type Description x
number The x value of the coordinate
y
number The y value of the coordinate
-
EventTriggerParams
-
Parameters passed to touch handler.
Properties:
Name Type Description eventobj
object yCoord
number