backtrader.bokeh.tab module

Tab base class.

Provides extensible tab architecture for creating custom tabs.

class backtrader.bokeh.tab.BokehTab[源代码]

基类:object

Tab base class.

Abstract base class for creating custom tabs. Subclasses must implement _is_useable and _get_panel methods.

_app

BacktraderBokeh application instance

_figurepage

Figure page instance

_client

Client instance (optional, for live mode)

_panel

Bokeh Panel instance

示例

class MyCustomTab(BokehTab):
def _is_useable(self):

return True

def _get_panel(self):

from bokeh.models import Div div = Div(text='<h1>My Content</h1>') return div, 'My Tab'

__init__(app, figurepage, client=None)[源代码]

Initialize tab.

参数:
  • app -- BacktraderBokeh application instance

  • figurepage -- Figure page instance

  • client -- Client instance (optional)

is_useable()[源代码]

Public interface: Check if tab is useable.

返回:

Whether tab is useable

返回类型:

bool

get_panel()[源代码]

Public interface: Get Bokeh Panel.

返回:

Bokeh Panel instance

返回类型:

Panel

property strategy

Get strategy instance.

property scheme

Get theme instance.