new TechnicalViews(stx, tcApiPath, tcBearerToken, mapToTCSymbology)
Controller class to assist in the creation and processing of Trading Central™ API requests.
Parameters:
Name | Type | Description |
---|---|---|
stx |
CIQ.ChartEngine | A chart instance to modify |
tcApiPath |
string | API URL |
tcBearerToken |
string | Trading Central API token |
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). |
Members
-
bollingerBands :CIQ.Studies.StudyDescriptor|null
-
Bollinger bands study descriptor
Type:
- CIQ.Studies.StudyDescriptor | null
-
colors :object
-
Colors used for displaying the lines and labels of the analysis.
Type:
- object
-
injections :CIQ.TechnicalViews~injections
-
Injection handles for displaying the lines and labels of the analysis.
Type:
-
interval :object
-
setPeriodicity interval values with TechnicalViews term as the key.
Type:
- object
-
panel :object
-
Display lines and labels of the analysis on the primary chart.
Type:
- object
-
rsi :CIQ.Studies.StudyDescriptor|null
-
RSI study descriptor
Type:
- CIQ.Studies.StudyDescriptor | null
-
stx :CIQ.ChartEngine
-
Chart engine
Type:
Methods
-
analysis( [options], symbolObject, callback)
-
A technical analysis request.
Parameters:
Name Type Argument Description options
Object <optional>
endpoint inputs (token & partner populated from instance)
Properties
Name Type Argument Default Description product
string <optional>
name of symbol
term
string <optional>
span context
days
number <optional>
1 how many days
last_ta
boolean <optional>
true get only the last analysis when true
symbolObject
object Symbol object
callback
function to receive the XML analysis document
- See:
-
- Trading Central specification document.
-
changeChartEngine(stx)
-
Change chart engine reference
Parameters:
Name Type Description stx
CIQ.ChartEngine Updated chart engine reference
-
createDrawInjections(levels, direction)
-
Create injections to display lines and labels of the analysis.
Parameters:
Name Type Description levels
object the chartlevels section of the analysis
direction
number a trend of bullish (positive) or bearish (negative)
-
createMouseInjections(levels, trend, node)
-
Create an injection to create events based on cursor position over analysis lines.
Parameters:
Name Type Description levels
object the chartlevels section of the analysis
trend
string a trend of 'bullish' or 'bearish'
node
HTMLElement element to dispatch events from
Example
// create injection TechnicalViews.createMouseInjections({}, 1, technicalviewsElement); // use this event to setup hover response technicalviewsElement.addEventListener('linehoverbegin', function(e) { // e.detail.line; // e.detail.lineY; // e.detail.price; }); // use this event to teardown hover response technicalviewsElement.addEventListener('linehoverend', function(e) { // e.detail.line; });
-
getCurrentTerm()
-
Determine the current term from the layout.
Returns:
the name of the term or undefined
- Type
- string
-
getDirectionName(directionValue)
-
Finds the direction name from a given direction value
Parameters:
Name Type Description directionValue
number the value of the watch direction
Returns:
the name of the direction
- Type
- string
-
getDirectionValue(watchList, term)
-
Finds the direction value from the watchlist and given term
Parameters:
Name Type Description watchList
Array.<Object> list of watches for a given analysis
term
String The term of the analysis
Returns:
the value of the watch
- Type
- number
-
getDocumentAgeString(documentDatetime)
-
Gets the document age as a string
Parameters:
Name Type Description documentDatetime
string The datetime field of the document
Returns:
A string representing the age of the document
- Type
- string
-
getStorySubsections(storyParagraphs)
-
Gets the required story subsections as an object
Parameters:
Name Type Description storyParagraphs
Array.<string> Returns:
the story as an object in sections
- Type
- Object
-
hideIndicators()
-
Remove previously shown studies used to aid in the analysis.
-
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
-
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.
Type Definitions
-
injections
-
Injection handles for displaying the lines and labels of the analysis.
Type:
- object
Properties:
Name Type Description draw
null | object Use
stxx.append('draw', function() { })
to render the labels.drawXaxis
null | object Use
stxx.append('drawXAxis', function() { })
to render the lines.mousemove
null | object Use
stxx.append('mousemove', function() { })
to create popup events.