Events

class AbstractChart.Events

The chart events class, accessed through chart.events

Events allow asynchronous and synchronous callbacks to be passed back into python.

Chart events can be subscribed to using: chart.events.<name> += <callable>

search -> (chart: Chart, string: str)

Fires upon searching. Searchbox will be automatically created.

new_bar -> (chart: Chart)

Fires when a new candlestick is added to the chart.

range_change -> (chart: Chart, bars_before: NUM, bars_after: NUM)

Fires when the range (visibleLogicalRange) changes.

click -> (chart: Chart, time: NUM, price: NUM)

Fires when the mouse is clicked, returning the time and price of the clicked location.

Tutorial: Topbar & Events