dexbot.strategies.config_parts.base_config module

class dexbot.strategies.config_parts.base_config.BaseConfig

Bases: object

classmethod configure(return_base_config=True)

Return a list of ConfigElement objects defining the configuration values for this class.

User interfaces should then generate widgets based on these values, gather data and save back to the config dictionary for the worker.

NOTE: When overriding you almost certainly will want to call the ancestor and then add your config values to the list.

Parameters:return_base_config – bool:
Returns:Returns a list of config elements
classmethod configure_details(include_default_tabs=True)

Return a list of ConfigElement objects defining the configuration values for this class.

User interfaces should then generate widgets based on these values, gather data and save back to the config dictionary for the worker.

NOTE: When overriding you almost certainly will want to call the ancestor and then add your config values to the list.

Parameters:include_default_tabs – bool:
Returns:Returns a list of Detail elements
class dexbot.strategies.config_parts.base_config.ConfigElement(key, type, default, title, description, extra)

Bases: tuple

Strategies have different needs for the details they want to show for the user. These elements help to build a custom details window for the strategy.

Tuple fields as follows:
  • Type: ‘graph’, ‘text’, ‘table’

  • Name: The name of the tab, shows at the top

  • Title: The title is shown inside the tab

  • File: Tabs can also show data from files, pass on the file name including the file extension

    in strategy’s configure_details.

    Below folders and representative file types that inside the folders.

    dexbot/graphs .png, .jpg dexbot/data .csv dexbot/logs .log, .txt (.csv, will print as raw data)

    NOTE: To avoid conflicts with other custom strategies, when generating names for files, use slug or worker’s name when generating files or create custom folders. Add relative path to ‘file’ parameter if file is in custom folder inside default folders. Like shown below:

    DetailElement(‘log’, ‘Worker log’, ‘Log of worker’s actions’, ‘my_custom_folder/example_worker.log’)

default

Alias for field number 2

description

Alias for field number 4

extra

Alias for field number 5

key

Alias for field number 0

title

Alias for field number 3

type

Alias for field number 1

dexbot.strategies.config_parts.base_config.DetailElement

alias of dexbot.strategies.config_parts.base_config.DetailTab