TradeCanvas

v1.61.0
io.github.bonguynvan/tradecanvas Checked 1 hour ago Published 29 days ago

Look up TradeCanvas chart indicators, options and drawing tools, and check options before use.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_indicators List built-in indicators

Lists the built-in indicators with their ids, names and where they draw (overlay: on the price pane; panel: in a pane of their own). Search by words of the id or name ("moving average", "bollinger"). Use the id with chart.addIndicator(id, params); get_indicator has the params and line keys.

ParameterTypeDescription
placementstringOnly those on the price pane, or only those in a pane of their own.
querystringWords to find in the id, short name or name.

get_indicator Get an indicator

One built-in indicator in full: its default params (what addIndicator takes), its inputs, its lines (the keys getIndicatorOutput returns per bar, which are often not the indicator id: RSI's line is `value`), its levels, and code that adds it and reads it. Takes the id, the short name or the full name.

ParameterTypeDescription
id *stringThe indicator's id ('rsi', 'bb'), short name or name.

list_drawing_tools List drawing tools

Lists the built-in drawing tools: the `type` that chart.addDrawing and chart.setDrawingTool take, the number of points (anchors) each needs, how the pointer draws it, and the options it offers. Search by words of the type or name ("fib", "channel").

ParameterTypeDescription
querystringWords to find in the type or name.

list_options List the options of an entry point

Lists the options that new ChartWidget(el, options), new Chart(el, options) or new ChartWidgetGrid(el, options) take: each name, its TypeScript type, its doc, and the values it allows where it allows only some. Search by words of the name or doc.

ParameterTypeDescription
target *stringThe entry point: ChartWidget (the full trading UI), Chart (the headless chart) or ChartWidgetGrid (several charts).
querystringWords to find in the option name or doc.

list_widget_features List ChartWidget feature switches

Lists the names ChartWidget's `features` option takes (every switch is on unless set false). A name without a dot turns a whole capability off ('alerts', 'hotkeys'); a dotted name, one place ('toolbar.screenshot', 'menu.chart.settings'). Narrow by a prefix.

ParameterTypeDescription
prefixstringOnly names starting with this, e.g. 'toolbar.' or 'menu.'.

list_style_keys List chart style keys

Lists the style keys of the chart's look and the kind of value each takes (color, boolean, lineStyle: 'solid' | 'dashed' | 'dotted', width: pixels up to 20). They go in Chart's `overrides` option or chart.applyOverrides({...}). Narrow by a prefix such as 'grid.' or 'series.candlestick.'.

ParameterTypeDescription
prefixstringOnly keys starting with this, e.g. 'grid.' or 'crosshair.'.

validate_options Check an options object

Checks an options object before it goes to new ChartWidget, new Chart or new ChartWidgetGrid: unknown option names (with the one likely meant, and where an option of another entry point belongs), values outside the allowed ones, numbers given as strings, intervals, feature switch names, style override keys and values, and languages, nested options included. Write functions and adapters as strings; they pass.

ParameterTypeDescription
options *objectThe options object, as JSON.
target *stringThe entry point: ChartWidget (the full trading UI), Chart (the headless chart) or ChartWidgetGrid (several charts).