Visualisation#
tradeexecutor.state.visualisation.Visualisation class.
- class Visualisation[source]#
Bases:
object
This object is returned from the strategy execution cycle. It allows you to plot values, add debug messages, etc. It is not used in any trading, but can help and visualize trade backtesting and execution.
- __init__(messages=<factory>, plots=<factory>)#
Methods
__init__
([messages, plots])add_message
(timestamp, content)Write a debug message.
from_dict
(kvs, *[, infer_missing])from_json
(s, *[, parse_float, parse_int, ...])plot_indicator
(timestamp, name, kind, value)Add a value to the output data and diagram.
schema
(*[, infer_missing, only, exclude, ...])to_dict
([encode_json])to_json
(*[, skipkeys, ensure_ascii, ...])Attributes
Messages for each strategy cycle.
plots
- messages: Dict[int, List[str]]#
Messages for each strategy cycle.
TODO: Because we cannot use datetime.datetime directly as a key in JSON, we use UNIX timestamp here to keep our state easily serialisable.
- add_message(timestamp, content)[source]#
Write a debug message.
Each message is associated to a different timepoint.