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 optionsObject <optional>
endpoint inputs (token & partner populated from instance)
Properties
Name Type Argument Default Description productstring <optional>
name of symbol
termstring <optional>
span context
daysnumber <optional>
1 how many days
last_taboolean <optional>
true get only the last analysis when true
symbolObjectobject Symbol object
callbackfunction to receive the XML analysis document
- See:
-
- Trading Central specification document.
-
changeChartEngine(stx)
-
Change chart engine reference
Parameters:
Name Type Description stxCIQ.ChartEngine Updated chart engine reference
-
createDrawInjections(levels, direction)
-
Create injections to display lines and labels of the analysis.
Parameters:
Name Type Description levelsobject the chartlevels section of the analysis
directionnumber 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 levelsobject the chartlevels section of the analysis
trendstring a trend of 'bullish' or 'bearish'
nodeHTMLElement 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 directionValuenumber 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 watchListArray.<Object> list of watches for a given analysis
termString 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 documentDatetimestring 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 storyParagraphsArray.<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 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
-
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 drawnull | object Use
stxx.append('draw', function() { })to render the labels.drawXaxisnull | object Use
stxx.append('drawXAxis', function() { })to render the lines.mousemovenull | object Use
stxx.append('mousemove', function() { })to create popup events.
