ChartRegistry#

API documentation for tradeexecutor.strategy.chart.definition.ChartRegistry Python class in Trading Strategy framework.

class ChartRegistry[source]#

Bases: object

Registry for charts.

  • Makes charts discoverable by name in the frontend

__init__(default_benchmark_pairs=None)[source]#

Initialize the chart registry.

Parameters:

default_benchmark_pairs (Optional[Collection[Union[Tuple[ChainId, str | None, str, str, float], Tuple[ChainId, str | None, str, str]]]]) – For single and multi-pair charts, define the default pairs to use.

Methods

__init__([default_benchmark_pairs])

Initialize the chart registry.

define(kind[, name])

get_chart_count()

Get the number of registered chart functions.

get_chart_function(name)

Get a chart function by name.

register(func, kind[, name])

Manually register a chart function.

Attributes

registry

id -> registered functions mappings

by_function

Function -> registered functions mappings.

__init__(default_benchmark_pairs=None)[source]#

Initialize the chart registry.

Parameters:

default_benchmark_pairs (Optional[Collection[Union[Tuple[ChainId, str | None, str, str, float], Tuple[ChainId, str | None, str, str]]]]) – For single and multi-pair charts, define the default pairs to use.

registry: dict[str, tradeexecutor.strategy.chart.definition.ChartCallback]#

id -> registered functions mappings

by_function: dict[tradeexecutor.strategy.chart.definition.ChartFunction, tradeexecutor.strategy.chart.definition.ChartCallback]#

Function -> registered functions mappings. Only useful for backtesting notebooks.

get_chart_function(name)[source]#

Get a chart function by name.

Parameters:

name (str) –

Return type:

tradeexecutor.strategy.chart.definition.ChartCallback | None

get_chart_count()[source]#

Get the number of registered chart functions.

Return type:

int

register(func, kind, name=None)[source]#

Manually register a chart function.

Parameters: